diff --git a/docker-compose.yml b/docker-compose.yml index 4025769..d466915 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: environment: ME_CONFIG_MONGODB_ADMINUSERNAME: root ME_CONFIG_MONGODB_ADMINPASSWORD: password - ME_CONFIG_MONGODB_URL: mongodb://root:password@mongo:27017/ + ME_CONFIG_MONGODB_URL: mongodb://mongo:27017/ ME_CONFIG_BASICAUTH: "false" patch_detector: @@ -34,6 +34,7 @@ services: environment: MONGO_USER: root MONGO_PASS: password + MONGO_HOST: mongo match_collector: image: git.vhaudiquet.fr/vhaudiquet/lolstats-match_collector:${GIT_COMMIT_HASH:-latest} @@ -47,6 +48,7 @@ services: environment: MONGO_USER: root MONGO_PASS: password + MONGO_HOST: mongo RIOT_API_KEY: ${RIOT_API_KEY} # restarter: @@ -61,5 +63,6 @@ services: environment: MONGO_USER: root MONGO_PASS: password + MONGO_HOST: mongo volumes: mongo_data: \ No newline at end of file diff --git a/frontend/server/utils/mongo.ts b/frontend/server/utils/mongo.ts index 34509ec..ab0ed8f 100644 --- a/frontend/server/utils/mongo.ts +++ b/frontend/server/utils/mongo.ts @@ -2,7 +2,7 @@ import { MongoClient } from 'mongodb' async function connectToDatabase() { // Create a MongoClient with a MongoClientOptions object to set the Stable API version - const client = new MongoClient(`mongodb://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@mongo:27017`) + const client = new MongoClient(`mongodb://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@${process.env.MONGO_HOST}`) await client.connect() return client } diff --git a/match_collector/index.ts b/match_collector/index.ts index 2e9165b..5b1b8f4 100644 --- a/match_collector/index.ts +++ b/match_collector/index.ts @@ -74,7 +74,7 @@ function handleError(response : Response) { async function connectToDatabase() { // Create a MongoClient with a MongoClientOptions object to set the Stable API version - const client = new MongoClient(`mongodb://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@mongo:27017`) + const client = new MongoClient(`mongodb://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@${process.env.MONGO_HOST}`) await client.connect() return client } diff --git a/patch_detector/index.ts b/patch_detector/index.ts index 646545b..a1e69dd 100644 --- a/patch_detector/index.ts +++ b/patch_detector/index.ts @@ -27,7 +27,7 @@ async function fetchLatestPatch() { async function connectToDatabase() { // Create a MongoClient with a MongoClientOptions object to set the Stable API version - const client = new MongoClient(`mongodb://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@mongo:27017`) + const client = new MongoClient(`mongodb://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@${process.env.MONGO_HOST}`) await client.connect() return client }