38 lines
763 B
YAML
38 lines
763 B
YAML
services:
|
|
postgres:
|
|
image: postgres:18-alpine
|
|
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql
|
|
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"
|
|
]
|
|
interval: 2s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
|
|
environment:
|
|
PORT: ${PORT:-3000}
|
|
NODE_ENV: production
|
|
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
|
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
volumes:
|
|
postgres_data: |