Skip to content

Commit

Permalink
feat: add health-checks in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Nastaliss committed Apr 1, 2024
1 parent 6b27953 commit 5d89bf5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
S3_ENDPOINT_URL: ${{ secrets.S3_ENDPOINT_URL }}
run: |
docker compose up -d --build --wait
sleep 20
docker compose logs backend
nc -vz localhost 8080
curl http://localhost:8080/docs
Expand Down
10 changes: 10 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ services:
- S3_ENDPOINT_URL=${S3_ENDPOINT_URL}
depends_on:
- db
healthcheck:
test: ['CMD-SHELL', 'nc -vz localhost 8080']
interval: 10s
timeout: 3s
retries: 3
db:
image: postgres:15-alpine
volumes:
Expand All @@ -33,6 +38,11 @@ services:
- POSTGRES_USER=dummy_pg_user
- POSTGRES_PASSWORD=dummy_pg_pwd
- POSTGRES_DB=dummy_pg_db
healthcheck:
test: ['CMD-SHELL', "sh -c 'pg_isready -U dummy_pg_user -d dummy_pg_db'"]
interval: 10s
timeout: 3s
retries: 3
proxy:
build: nginx
ports:
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ services:
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_REGION=${S3_REGION}
- S3_ENDPOINT_URL=${S3_ENDPOINT_URL}
healthcheck:
test: ['CMD-SHELL', 'nc -vz localhost 8080']
interval: 10s
timeout: 3s
retries: 3
depends_on:
db:
condition: service_healthy
Expand Down

0 comments on commit 5d89bf5

Please sign in to comment.