Files
sn-api/docker-compose.yml

46 lines
1.0 KiB
YAML

---
services:
db:
image: "postgres:17"
container_name: "db"
restart: always
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USER}
POSTGRES_DB: ${DB_NAME}
PGPORT: ${DB_PORT}
ports:
- ${DB_PORT}:${DB_PORT}
volumes:
- ./database/db/postgres-data:/var/lib/postgresql/data
networks:
- sn-api-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
node_backend:
container_name: "node_backend"
restart: always
build: .
ports:
- ${NODE_PORT}:${NODE_PORT}
volumes:
- ./docker-entrypoint.sh:/usr/src/app/docker-entrypoint.sh
networks:
- sn-api-net
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "nc -vz localhost ${NODE_PORT}"]
interval: 10s
timeout: 2s
retries: 5
start_period: 10s
networks:
sn-api-net: