Skip to content

Commit b6eceb3

Browse files
authored
Merge pull request #53 from amfoss/praveshan-develop
Health check
2 parents d482beb + e1cf4be commit b6eceb3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ dist/
3838
*.tmp
3939
txt.txt
4040
credentials.json
41+
docker-compose.override.yml

docker-compose.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ services:
1111
depends_on:
1212
- db
1313
command: bash -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"
14-
volumes:
15-
- ./alembic/versions:/app/alembic/versions
14+
depends_on:
15+
db:
16+
# This now waits for the db to be healthy, not just started
17+
condition: service_healthy
1618

1719
db:
1820
image: postgres:14
@@ -27,6 +29,11 @@ services:
2729
- postgres_data:/var/lib/postgresql/data
2830
ports:
2931
- "5432:5432"
32+
healthcheck:
33+
test: ["CMD-SHELL", "pg_isready -U ammentor_user -d praveshan-ammentor"]
34+
interval: 5s
35+
timeout: 5s
36+
retries: 5
3037

3138
volumes:
3239
postgres_data:

0 commit comments

Comments
 (0)