From 628c54d56982e1a32cbeebe33c80bb6289ee73dd Mon Sep 17 00:00:00 2001 From: cheetah Date: Tue, 31 Mar 2020 12:08:24 +0200 Subject: [PATCH] update 1.2 --- config.json | 4 ---- database.js | 6 +++--- docker-compose.yml | 6 ++++-- 3 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 config.json diff --git a/config.json b/config.json deleted file mode 100644 index cd3faee..0000000 --- a/config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "mongodbURI": "mongodb://admin:admin@mongo:27017", - "mongodbName": "mcaccountschecker" -} diff --git a/database.js b/database.js index b572149..3f146cc 100644 --- a/database.js +++ b/database.js @@ -1,12 +1,12 @@ -const config = require('./config') +//const config = require('./config') const mongoose = require('mongoose') const mongoOptions = { useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: true, - dbName: config.mongodbName + dbName: process.env.MONGO_DBNAME || 'mcaccountschecker', } -mongoose.connect(config.mongodbURI, mongoOptions, (err) => { +mongoose.connect(process.env.MONGO_DBURI || 'mongodb://admin:admin@mongo:27017', mongoOptions, (err) => { if (!!err) process.exit(1) console.log('CONNECTED TO MONGODB') }) diff --git a/docker-compose.yml b/docker-compose.yml index 15c8fe0..1f45660 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,9 +15,11 @@ services: mcbulkaccountcheckerandwatcher: image: "cuddlycheetah/mcbulkaccountcheckerandwatcher" restart: unless-stopped + # if you dont need the mongodb container, mae sure to remove these two lines too links: - mongo - volumes: - - ./config.json/:/usr/src/config.json + environment: + - MONGO_DBURI: 'mongodb://admin:admin@mongo:27017' + - MONGO_DBNAME: 'mcaccountschecker' ports: - "6969:6969/tcp"