Browse Source

Update docker for mongo

rigwild 1 year ago
parent
commit
23eced6d79
3 changed files with 4 additions and 2 deletions
  1. 1 1
      config.js
  2. 2 1
      docker-compose.yml
  3. 1 0
      server/index.js

+ 1 - 1
config.js

@@ -16,7 +16,7 @@ export const imageServedUrl = apiPrefix + '/images'
 export const serverPort = parseInt(process.env.PORT, 10) || 5000
 
 // MongoDB database connection URI
-export const mongoDatabaseURI = process.env.MONGO_URI || 'mongodb://mongo:27017/webexpe'
+export const mongoDatabaseURI = process.env.MONGO_URI || 'mongodb://localhost:27017/webexpe'
 
 // The directory where the images are stored
 export const imagesPath = TEST_MODE

+ 2 - 1
docker-compose.yml

@@ -23,9 +23,10 @@ services:
         ports:
           - "${PORT:-5000}:5000"
         environment:
-            NODE_ENV: production
+            NODE_ENV: "production"
             SERVE_CLIENT: "${SERVE_CLIENT:-true}"
             PORT: "5000"
+            MONGO_URI: "${MONGO_URI:-mongodb://mongo:27017/webexpe}"
         links:
             - mongo
         volumes:

+ 1 - 0
server/index.js

@@ -12,6 +12,7 @@ import { apiPrefix, imageServedUrl, serverPort, serveClient, imagesPath, logger
 import startWebSocketServer from './webSocket'
 import connectDb from './database'
 const morgan = require('morgan')
+
 const app = express()
 
 // Activating logging