Despliegue local

This commit is contained in:
2026-05-06 11:10:35 +02:00
parent 5d131413ed
commit a1fa7b42ce
10 changed files with 35 additions and 18 deletions

View File

@@ -0,0 +1,57 @@
name: sf-monitorizacion-health
networks:
default:
driver: bridge
name: network-test # Tiene que coincidir con el compose objetivo
services:
sf-monitorizacion-health:
container_name: sf-monitorizacion-health
image: sf-monitorizacion-health
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",
"wget -q --spider http://127.0.0.1:${PORT:-3000}/health || exit 1",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
depends_on:
postgresql-health:
condition: service_healthy
postgresql-health:
container_name: postgresql-health
image: postgres:16.1
env_file:
- .env
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- ./sql-data/:/var/lib/postgres/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
command: -p 5432