Skip to content

Commit 6db1cc7

Browse files
committed
Use npm package wait-on instead of sleep to prevent timing issues
1 parent ee74d0c commit 6db1cc7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ WORKDIR /home/node/coc-api
99
# Copy contents of local folder to `WORKDIR`
1010
COPY . .
1111

12-
# Install nodemon globally
13-
RUN npm install --global nodemon db-migrate db-migrate-mysql
12+
# Install npm packages globally
13+
RUN npm install --global nodemon db-migrate db-migrate-mysql wait-on
1414

1515
# Install dependencies from package.json
1616
RUN npm install --quiet --no-warnings

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ services:
3737
depends_on:
3838
- db
3939
- mailhog
40-
command: bash -c "sleep 5 && db-migrate up && npm run start"
40+
command: bash -c "wait-on tcp:db:3306 && db-migrate up && npm run start"

0 commit comments

Comments
 (0)