148 lines
3.5 KiB
YAML
148 lines
3.5 KiB
YAML
# docker-compose.overrride.yml
|
|
# Docker Comose para entorno de desarrollo o development.
|
|
|
|
|
|
services:
|
|
npm:
|
|
image: jc21/nginx-proxy-manager:latest
|
|
restart: unless-stopped
|
|
depends_on:
|
|
app:
|
|
condition: service_healthy
|
|
auth:
|
|
condition: service_healthy
|
|
ports:
|
|
- "80:80" # HTTP público
|
|
- "81:81" # UI de administración NPM
|
|
- "443:443" # HTTPS público
|
|
volumes:
|
|
- npm_data:/data # config + DB (SQLite)
|
|
- npm_letsencrypt:/etc/letsencrypt
|
|
networks:
|
|
- suitecoffee-net
|
|
|
|
app:
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
tenants:
|
|
condition: service_healthy
|
|
image: node:20-bookworm
|
|
ports:
|
|
- 3000:3000
|
|
working_dir: /app
|
|
user: "${UID:-1000}:${GID:-1000}"
|
|
volumes:
|
|
- ./services/app:/app:rw
|
|
- ./services/app/node_modules:/app/node_modules
|
|
env_file:
|
|
- ./services/app/.env.development
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV}
|
|
command: npm run dev
|
|
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:
|
|
- suitecoffee-net
|
|
|
|
auth:
|
|
image: node:20-bookworm
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
ports:
|
|
- 4000:4000
|
|
working_dir: /app
|
|
user: "${UID:-1000}:${GID:-1000}"
|
|
volumes:
|
|
- ./services/auth:/app:rw
|
|
- ./services/auth/node_modules:/app/node_modules
|
|
env_file:
|
|
- ./services/auth/.env.development
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV}
|
|
command: npm run dev
|
|
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:
|
|
- suitecoffee-net
|
|
|
|
db:
|
|
image: postgres:16
|
|
environment:
|
|
POSTGRES_DB: ${DB_NAME}
|
|
POSTGRES_USER: ${DB_USER}
|
|
POSTGRES_PASSWORD: ${DB_PASS}
|
|
ports:
|
|
- ${DB_LOCAL_PORT}:${DB_DOCKER_PORT}
|
|
volumes:
|
|
- suitecoffee-db:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
start_period: 10s
|
|
networks:
|
|
- suitecoffee-net
|
|
|
|
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
|
|
ports:
|
|
- ${TENANTS_DB_LOCAL_PORT}:${TENANTS_DB_DOCKER_PORT}
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${TENANTS_DB_USER} -d ${TENANTS_DB_NAME}"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
start_period: 10s
|
|
networks:
|
|
- suitecoffee-net
|
|
|
|
dbeaver:
|
|
image: dbeaver/cloudbeaver:latest
|
|
# depends_on:
|
|
# tenants:
|
|
# condition: service_healthy
|
|
# db:
|
|
# condition: service_healthy
|
|
restart: unless-stopped
|
|
ports:
|
|
- 8978:8978
|
|
volumes:
|
|
- dbeaver_logs:/opt/cloudbeaver/logs
|
|
- dbeaver_workspace:/opt/cloudbeaver/workspace
|
|
networks:
|
|
- suitecoffee-net
|
|
|
|
volumes:
|
|
tenants-db:
|
|
suitecoffee-db:
|
|
|
|
npm_data:
|
|
npm_letsencrypt:
|
|
dbeaver_logs:
|
|
dbeaver_workspace:
|
|
|
|
networks:
|
|
suitecoffee-net:
|
|
driver: bridge |