chore: add healthcheck for db

This commit is contained in:
Andrew Bastin
2024-03-21 00:29:43 +05:30
parent 31a275b971
commit 4522aeb79a

View File

@@ -1,3 +1,6 @@
# THIS IS NOT TO BE USED FOR PERSONAL DEPLOYMENTS!
# Internal Docker Compose Image used for internal testing deployments
version: "3.7"
services:
@@ -8,6 +11,15 @@ services:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: testpass
POSTGRES_DB: hoppscotch
healthcheck:
test:
[
"CMD-SHELL",
"sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'"
]
interval: 5s
timeout: 5s
retries: 10
hoppscotch-aio:
container_name: hoppscotch-aio
@@ -21,7 +33,8 @@ services:
env_file:
- ./.env
depends_on:
- hoppscotch-db
hoppscotch-db:
condition: service_healthy
command: ["sh", "-c", "pnpm exec prisma migrate deploy && node /usr/src/app/aio_run.mjs"]
healthcheck:
test: