Skip to content

Commit

Permalink
Start docker container start order (#435)
Browse files Browse the repository at this point in the history
Co-authored-by: msm <[email protected]>
  • Loading branch information
msm-cert and msm-code authored Nov 18, 2024
1 parent 3d7784e commit d0f5387
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
32 changes: 23 additions & 9 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ services:
dockerfile: deploy/docker/dev.web.Dockerfile
ports:
- "5000:5000"
links:
- redis
- postgres
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
volumes:
- "${SAMPLES_DIR}:/mnt/samples"
- .:/usr/src/app
depends_on:
- "redis"
- "postgres"
environment:
- "REDIS_HOST=redis"
- "MQUERY_BACKEND=tcp://ursadb:9281"
- "DATABASE_URL=postgresql://postgres:password@postgres:5432/mquery"
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:5000/api/server || exit 1"]
interval: 5s
timeout: 5s
retries: 30
dev-daemon:
build:
context: .
Expand All @@ -43,9 +47,14 @@ services:
- "${SAMPLES_DIR}:/mnt/samples"
- .:/usr/src/app
depends_on:
- "redis"
- "ursadb"
- "postgres"
dev-web:
condition: service_healthy
redis:
condition: service_started
ursadb:
condition: service_started
postgres:
condition: service_healthy
environment:
- "REDIS_HOST=redis"
- "MQUERY_BACKEND=tcp://ursadb:9281"
Expand Down Expand Up @@ -76,3 +85,8 @@ services:
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_DB=mquery
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ services:
- "REDIS_HOST=redis"
- "MQUERY_BACKEND=tcp://ursadb:9281"
- "DATABASE_URL=postgresql://postgres:password@postgres:5432/mquery"
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:5000/api/server || exit 1"]
interval: 5s
timeout: 5s
retries: 30
daemon:
restart: always
build:
Expand All @@ -30,6 +35,8 @@ services:
volumes:
- "${SAMPLES_DIR}:/mnt/samples"
depends_on:
web:
condition: service_healthy
redis:
condition: service_started
ursadb:
Expand Down

0 comments on commit d0f5387

Please sign in to comment.