diff --git a/apps/agora/api/.env.example b/apps/agora/api/.env.example index e0c94ffc5..f3abb2555 100644 --- a/apps/agora/api/.env.example +++ b/apps/agora/api/.env.example @@ -1,2 +1,6 @@ -MONGODB_URI="mongodb://root:changeme@agora-mongo:27017/agora?authSource=admin" +MONGODB_PASS="changeme" +MONGODB_USER="root" +MONGODB_HOST="agora-mongo" +MONGODB_PORT="27017" +MONGODB_NAME="agora" NODE_ENV="development" \ No newline at end of file diff --git a/apps/agora/api/src/api.ts b/apps/agora/api/src/api.ts index f1ff703a9..5a1811a4e 100644 --- a/apps/agora/api/src/api.ts +++ b/apps/agora/api/src/api.ts @@ -14,13 +14,39 @@ import { teamsRoute, } from './components'; -const mongoUri = process.env.MONGODB_URI; +const mongodbUser = process.env.MONGODB_USER; +const mongodbPass = process.env.MONGODB_PASS; +const mongodbHost = process.env.MONGODB_HOST; +const mongodbPort = process.env.MONGODB_PORT; +const mongodbName = process.env.MONGODB_NAME; -if (!mongoUri) { - console.error('No MONGODB_URI environment variable has been defined.'); +if (!mongodbUser) { + console.error('No MONGODB_USER environment variable has been defined.'); process.exit(1); } +if (!mongodbPass) { + console.error('No MONGODB_PASS environment variable has been defined.'); + process.exit(1); +} + +if (!mongodbHost) { + console.error('No MONGODB_HOST environment variable has been defined.'); + process.exit(1); +} + +if (!mongodbPort) { + console.error('No MONGODB_PORT environment variable has been defined.'); + process.exit(1); +} + +if (!mongodbName) { + console.error('No MONGODB_NAME environment variable has been defined.'); + process.exit(1); +} + +const mongoUri = `mongodb://${mongodbUser}:${mongodbPass}@${mongodbHost}:${mongodbPort}/${mongodbName}?authSource=admin`; + mongoose .connect(mongoUri) .then(() => console.log('Connected to MongoDB')) diff --git a/apps/agora/app/.env.example b/apps/agora/app/.env.example index d7191171b..57aed7fa9 100644 --- a/apps/agora/app/.env.example +++ b/apps/agora/app/.env.example @@ -1,4 +1,6 @@ API_DOCS_URL="http://localhost:8000/api-docs" APP_VERSION="4.0.0" CSR_API_URL="http://localhost:8000/api/v1" -SSR_API_URL="http://agora-api:3333/v1" \ No newline at end of file +SSR_API_URL="http://agora-api:3333/v1" +ROLLBAR_TOKEN="e788198867474855a996485580b08d03" +TAG_NAME="agora/v4.0.0-rc1" \ No newline at end of file diff --git a/apps/agora/app/src/config/config.json b/apps/agora/app/src/config/config.json index 966efbcbb..a13f16c93 100644 --- a/apps/agora/app/src/config/config.json +++ b/apps/agora/app/src/config/config.json @@ -4,5 +4,5 @@ "csrApiUrl": "http://localhost:3333/v1", "ssrApiUrl": "http://agora-api:3333/v1", "rollbarToken": "e788198867474855a996485580b08d03", - "tagName": "agora/v0.0.2" + "tagName": "agora/v4.0.0-rc1" } diff --git a/docker/agora/services/apex.yml b/docker/agora/services/apex.yml index a2a6b268e..1a3384979 100644 --- a/docker/agora/services/apex.yml +++ b/docker/agora/services/apex.yml @@ -12,7 +12,7 @@ services: ports: - '8000:80' healthcheck: - test: ['CMD', 'curl', '--fail', 'http://localhost:80/health'] + test: ['CMD', 'wget', '--spider', '--quiet', 'http://localhost:80/health'] interval: 30s timeout: 10s retries: 3