58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: sf-nfc-server
|
|
networks:
|
|
default:
|
|
driver: bridge
|
|
name: network-test # Tiene que coincidir con el compose objetivo
|
|
|
|
services:
|
|
sf-nfc-api:
|
|
container_name: sf-nfc-api
|
|
image: sf-nfc-api
|
|
build:
|
|
context: ./
|
|
dockerfile: deployment/local/docker/Dockerfile.local
|
|
args:
|
|
PORT: "${PORT:-3000}"
|
|
develop:
|
|
watch:
|
|
- path: ./src
|
|
action: sync
|
|
target: /usr/local/app/packages
|
|
- path: ./package.json
|
|
action: rebuild
|
|
ports:
|
|
- ${PORT}:${PORT}
|
|
env_file:
|
|
- .env
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
'node -e "fetch(''http://localhost:'' + (process.env.PORT || 3000) + ''/health'').then(r => { if (!r.ok) process.exit(1) }).catch(() => process.exit(1))"',
|
|
]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 15s
|
|
depends_on:
|
|
postgresql-nfc:
|
|
condition: service_healthy
|
|
|
|
postgresql-nfc:
|
|
container_name: postgresql-nfc
|
|
image: postgres:16.1
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
|
|
volumes:
|
|
- ./sql-data/:/var/lib/postgres/data
|
|
- ./deployment/database/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
|
interval: 5s
|
|
retries: 5
|
|
start_period: 5s
|
|
timeout: 5s
|