Skip to content

Commit

Permalink
Merge pull request #167 from panoratech/docker-compose-fi
Browse files Browse the repository at this point in the history
🔨 Update healthcheck in docker-compose
  • Loading branch information
rflihxyz authored Dec 14, 2023
2 parents bb77bae + 949b55c commit 61b3aec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 8 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ services:
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./pg_data:/var/lib/postgresql/data
- ./packages/api/scripts/init.sql:/docker-entrypoint-initdb.d/init.sql
Expand All @@ -33,8 +38,10 @@ services:
unless-stopped
ports:
- 3000:3000
command: sh -c "/app/packages/api/scripts/pull-database.sh && pnpm run build && node dist/src/main.js"
depends_on:
- postgres
postgres:
condition: service_healthy
networks:
- backend

Expand All @@ -45,15 +52,6 @@ services:
- "6379:6379"
volumes:
- ./redis-data:/data

docs:
build:
context: ./
dockerfile: ./docs/Dockerfile
restart:
always
ports:
- 5000:3000

webapp:
build:
Expand Down
2 changes: 2 additions & 0 deletions packages/api/scripts/pull-database.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh

# SCRIPT TO USE IF YOU WANT TO UPDATE YOUR PRISMA MODEL BASED ON YOUR DB
# it pulls changes from your database to your Prisma schema
# DB => PRISMA MODEL
Expand Down

0 comments on commit 61b3aec

Please sign in to comment.