From c23f72b615c9cc8c9cb166c2d24cf53be95b95cb Mon Sep 17 00:00:00 2001 From: Fernando Derkoski Date: Tue, 14 Jul 2020 23:39:25 -0300 Subject: [PATCH 1/2] Fixes #27 --- server/Dockerfile | 5 ++++- server/docker-compose.yml | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index f61aefd..c1aee31 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -10,4 +10,7 @@ RUN npm install COPY . . -CMD [ "pm2-runtime", "start", "ecosystem.config.js" ] +ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait +RUN chmod +x /wait + +CMD [ "/wait", "&&", "pm2-runtime", "start", "ecosystem.config.js" ] diff --git a/server/docker-compose.yml b/server/docker-compose.yml index f2637ca..491a802 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -12,7 +12,6 @@ services: MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD} api: - # TODO: wait for mongodb to be available... image: entropychat.api build: . restart: on-failure @@ -25,6 +24,7 @@ services: ports: - ${PORT}:${PORT} environment: + WAIT_HOSTS: ${MONGO_HOST}:${MONGO_PORT} PORT: ${PORT} JWT_SECRET: ${JWT_SECRET} GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID} @@ -37,4 +37,4 @@ services: volumes: npm_cache: - node_modules: \ No newline at end of file + node_modules: From b586098f861998c087c25c3c87e178e264b7a6b6 Mon Sep 17 00:00:00 2001 From: Fernando Derkoski Date: Mon, 3 Aug 2020 11:30:51 -0300 Subject: [PATCH 2/2] :fix: - Changed the version of `docker-compose-wait` - Changed the CMD on `Dockerfile` --- server/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index c1aee31..4e05271 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -10,7 +10,7 @@ RUN npm install COPY . . -ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait +ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /wait RUN chmod +x /wait -CMD [ "/wait", "&&", "pm2-runtime", "start", "ecosystem.config.js" ] +CMD /wait && pm2-runtime start ecosystem.config.js