Q58Connect/docker-compose.yaml
2024-09-22 23:32:49 +08:00

36 lines
756 B
YAML

version: "3"
services:
web:
build: .
ports:
- "3000:3000"
restart: always
environment:
DATABASE_URL: postgresql://next:next@db:5432/next
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:3000/api/health"]
interval: 5s
timeout: 5s
retries: 5
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: next
POSTGRES_USER: next
POSTGRES_PASSWORD: next
volumes:
- next-db-data:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
next-db-data: