Se adoptó la versión actualmente recomandada por el equipo de docker el formado "compose.yaml" También se crearon nuevos scripts y actualizaron algunos para adaptarse a los nuevos archivos.
108 lines
2.5 KiB
YAML
108 lines
2.5 KiB
YAML
# compose.prod.yml
|
|
# Docker Comose para entorno de producción o production.
|
|
|
|
|
|
services:
|
|
|
|
app:
|
|
# depends_on:
|
|
# db:
|
|
# condition: service_healthy
|
|
# tenants:
|
|
# condition: service_healthy
|
|
build:
|
|
context: ./services/app
|
|
dockerfile: Dockerfile.production
|
|
expose:
|
|
- ${APP_LOCAL_PORT}
|
|
volumes:
|
|
- ./services/app:/app
|
|
env_file:
|
|
- ./services/app/.env.production
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV}
|
|
# healthcheck:
|
|
# # IMPORTANTE: asegurate de tener curl instalado en la imagen de app (ver nota abajo)
|
|
# test: ["CMD-SHELL", "curl -fsS http://localhost:${APP_DOCKER_PORT}/health || exit 1"]
|
|
# interval: 10s
|
|
# timeout: 3s
|
|
# retries: 10
|
|
# start_period: 20s
|
|
# restart: unless-stopped
|
|
networks:
|
|
net:
|
|
aliases: [prod-app]
|
|
command: npm run start
|
|
|
|
auth:
|
|
# depends_on:
|
|
# db:
|
|
# condition: service_healthy
|
|
build:
|
|
context: ./services/auth
|
|
dockerfile: Dockerfile.production
|
|
expose:
|
|
- ${AUTH_LOCAL_PORT}
|
|
volumes:
|
|
- ./services/auth:/app
|
|
env_file:
|
|
- ./services/auth/.env.production
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV}
|
|
command: npm run start
|
|
# restart: unless-stopped
|
|
# healthcheck:
|
|
# test: ["CMD-SHELL", "curl -fsS http://localhost:${AUTH_DOCKER_PORT}/health || exit 1"]
|
|
# interval: 10s
|
|
# timeout: 3s
|
|
# retries: 10
|
|
# start_period: 15s
|
|
networks:
|
|
net:
|
|
aliases: [prod-auth]
|
|
|
|
db:
|
|
image: postgres:16
|
|
environment:
|
|
POSTGRES_DB: ${DB_NAME}
|
|
POSTGRES_USER: ${DB_USER}
|
|
POSTGRES_PASSWORD: ${DB_PASS}
|
|
volumes:
|
|
- suitecoffee-db:/var/lib/postgresql/data
|
|
# healthcheck:
|
|
# test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
|
# interval: 5s
|
|
# timeout: 3s
|
|
# retries: 20
|
|
# start_period: 10s
|
|
networks:
|
|
net:
|
|
aliases: [prod-db]
|
|
# restart: unless-stopped
|
|
|
|
tenants:
|
|
image: postgres:16
|
|
environment:
|
|
POSTGRES_DB: ${TENANTS_DB_NAME}
|
|
POSTGRES_USER: ${TENANTS_DB_USER}
|
|
POSTGRES_PASSWORD: ${TENANTS_DB_PASS}
|
|
volumes:
|
|
- tenants-db:/var/lib/postgresql/data
|
|
# healthcheck:
|
|
# test: ["CMD-SHELL", "pg_isready -U ${TENANTS_DB_USER} -d ${TENANTS_DB_NAME}"]
|
|
# interval: 5s
|
|
# timeout: 3s
|
|
# retries: 20
|
|
# start_period: 10s
|
|
networks:
|
|
net:
|
|
aliases: [prod-tenants]
|
|
# restart: unless-stopped
|
|
|
|
volumes:
|
|
tenants-db:
|
|
suitecoffee-db:
|
|
|
|
networks:
|
|
net:
|
|
driver: bridge |