blizzless-diiis/docker-compose.yml
Mateleo aecc164a7c chore(Dockerfile): remove unused COPY command for db directory
refactor(docker-compose.yml): add healthcheck to ensure database service is healthy before starting the server
feat(docker-compose.yml): add condition to wait for database service to be ready before starting the server
2024-11-22 13:39:30 +01:00

29 lines
604 B
YAML

services:
diiis-na-server:
build:
context: .
dockerfile: Dockerfile
container_name: diiis-na-server
depends_on:
- db:
condition: service_healthy
db:
image: postgres:17
container_name: diiis-na-db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=diablo
volumes:
- db-data:/var/lib/postgresql/data
- ./db/initdb:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
volumes:
db-data: