Skip to content

Commit 1abdf9b

Browse files
committed
chore: fix running of fastapi container because postgres didn't have a healthcheck
The error was: dependency failed to start: container fastapi-postgres-1 has no healthcheck configured Part of #13
1 parent 4e2f076 commit 1abdf9b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docker/docker-compose.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ services:
3636
- POSTGRES_DB=test
3737
volumes:
3838
- ./categories.postgres.sql:/docker-entrypoint-initdb.d/categories.sql
39+
# Note: double dollar sign protects variables from docker compose interpolation
40+
test: "pg_isready --user $$POSTGRES_USER --quiet --timeout 0"
41+
interval: 1s
42+
timeout: 5s
43+
retries: 10
44+
start_period: 1s
3945

4046
express-js:
4147
build: ../examples/js/express/mysql

0 commit comments

Comments
 (0)