Actualización de archivos compose para centralizar y tanto NPM como El gestó de db's dentro de un proyecto propio "suitecoffee_tools" con acceso a las redes de producción como de desarrollo
This commit is contained in:
parent
c42814f963
commit
5342fb489d
@ -1,47 +0,0 @@
|
||||
# compose.dbeaver.yaml
|
||||
|
||||
name: suitecoffee
|
||||
|
||||
services:
|
||||
dbeaver:
|
||||
image: dbeaver/cloudbeaver:latest
|
||||
ports:
|
||||
- 8978:8978
|
||||
environment:
|
||||
TZ: America/Montevideo
|
||||
volumes:
|
||||
- dbeaver_logs:/opt/cloudbeaver/logs
|
||||
- dbeaver_workspace:/opt/cloudbeaver/workspace
|
||||
networks:
|
||||
suitecoffee_prod_net:
|
||||
aliases:
|
||||
- prod-auth
|
||||
- prod-app
|
||||
- prod-db
|
||||
- prod-tenants
|
||||
suitecoffee_dev_net:
|
||||
aliases:
|
||||
- dev-auth
|
||||
- dev-app
|
||||
- dev-db
|
||||
- dev-tenants
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost:81 || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 20s
|
||||
# networks:
|
||||
# - suitecoffee_dev_net
|
||||
# - suitecoffee_prod_net
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
suitecoffee_dev_net:
|
||||
external: true
|
||||
suitecoffee_prod_net:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
dbeaver_logs:
|
||||
dbeaver_workspace:
|
||||
@ -5,11 +5,6 @@
|
||||
services:
|
||||
|
||||
app:
|
||||
# depends_on:
|
||||
# db:
|
||||
# condition: service_healthy
|
||||
# tenants:
|
||||
# condition: service_healthy
|
||||
image: node:20-bookworm
|
||||
expose:
|
||||
- ${APP_LOCAL_PORT}
|
||||
@ -22,14 +17,6 @@ services:
|
||||
- ./services/app/.env.development
|
||||
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: [dev-app]
|
||||
@ -37,9 +24,6 @@ services:
|
||||
|
||||
auth:
|
||||
image: node:20-bookworm
|
||||
# depends_on:
|
||||
# db:
|
||||
# condition: service_healthy
|
||||
expose:
|
||||
- ${AUTH_LOCAL_PORT}
|
||||
working_dir: /app
|
||||
@ -52,13 +36,6 @@ services:
|
||||
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:
|
||||
net:
|
||||
aliases: [dev-auth]
|
||||
@ -71,16 +48,9 @@ services:
|
||||
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: [dev-db]
|
||||
# restart: unless-stopped
|
||||
|
||||
tenants:
|
||||
image: postgres:16
|
||||
@ -90,16 +60,9 @@ services:
|
||||
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: [dev-tenants]
|
||||
# restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
tenants-db:
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
# compose.npm.yaml
|
||||
|
||||
name: suitecoffee
|
||||
|
||||
services:
|
||||
|
||||
npm:
|
||||
image: jc21/nginx-proxy-manager:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80" # HTTP público
|
||||
- "81:81" # UI de administración
|
||||
environment:
|
||||
TZ: America/Montevideo
|
||||
volumes:
|
||||
- npm_data:/data
|
||||
- npm_letsencrypt:/etc/letsencrypt
|
||||
networks:
|
||||
suitecoffee_prod_net:
|
||||
aliases:
|
||||
- prod-auth
|
||||
- prod-app
|
||||
- prod-db
|
||||
- prod-tenants
|
||||
suitecoffee_dev_net:
|
||||
aliases:
|
||||
- dev-auth
|
||||
- dev-app
|
||||
- dev-db
|
||||
- dev-tenants
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost:81 || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 20s
|
||||
|
||||
networks:
|
||||
suitecoffee_dev_net:
|
||||
external: true
|
||||
suitecoffee_prod_net:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
npm_data:
|
||||
npm_letsencrypt:
|
||||
@ -5,11 +5,6 @@
|
||||
services:
|
||||
|
||||
app:
|
||||
# depends_on:
|
||||
# db:
|
||||
# condition: service_healthy
|
||||
# tenants:
|
||||
# condition: service_healthy
|
||||
build:
|
||||
context: ./services/app
|
||||
dockerfile: Dockerfile.production
|
||||
@ -21,23 +16,12 @@ services:
|
||||
- ./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
|
||||
@ -50,13 +34,6 @@ services:
|
||||
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]
|
||||
@ -69,16 +46,9 @@ services:
|
||||
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
|
||||
@ -88,16 +58,9 @@ services:
|
||||
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:
|
||||
|
||||
61
compose.tools.yaml
Normal file
61
compose.tools.yaml
Normal file
@ -0,0 +1,61 @@
|
||||
# compose.tools.yaml
|
||||
name: suitecoffee_tools
|
||||
|
||||
services:
|
||||
|
||||
dbeaver:
|
||||
image: dbeaver/cloudbeaver:latest
|
||||
profiles: [dbeaver]
|
||||
ports:
|
||||
- 8978:8978
|
||||
environment:
|
||||
TZ: America/Montevideo
|
||||
volumes:
|
||||
- dbeaver_logs:/opt/cloudbeaver/logs
|
||||
- dbeaver_workspace:/opt/cloudbeaver/workspace
|
||||
networks:
|
||||
suitecoffee_prod_net: {}
|
||||
suitecoffee_dev_net: {}
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost:8978 || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 20s
|
||||
restart: unless-stopped
|
||||
|
||||
npm:
|
||||
image: jc21/nginx-proxy-manager:latest
|
||||
profiles: [npm]
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80" # HTTP público
|
||||
- "81:81" # UI de administración
|
||||
environment:
|
||||
TZ: America/Montevideo
|
||||
volumes:
|
||||
- npm_data:/data
|
||||
- npm_letsencrypt:/etc/letsencrypt
|
||||
networks:
|
||||
suitecoffee_prod_net: {}
|
||||
suitecoffee_dev_net: {}
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost:81 || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 20s
|
||||
|
||||
|
||||
networks:
|
||||
suitecoffee_dev_net:
|
||||
external: true
|
||||
suitecoffee_prod_net:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
npm_data:
|
||||
npm_letsencrypt:
|
||||
|
||||
dbeaver_logs:
|
||||
dbeaver_workspace:
|
||||
109
compose.yaml
109
compose.yaml
@ -4,105 +4,52 @@ name: ${COMPOSE_PROJECT_NAME:-suitecoffee}
|
||||
|
||||
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}
|
||||
# command: npm run start
|
||||
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
|
||||
# networks:
|
||||
# net:
|
||||
# aliases: [prod-app]
|
||||
restart: unless-stopped
|
||||
# app:
|
||||
# depends_on:
|
||||
# db:
|
||||
# condition: service_healthy
|
||||
# tenants:
|
||||
# condition: service_healthy
|
||||
# healthcheck:
|
||||
# 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
|
||||
|
||||
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
|
||||
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]
|
||||
restart: unless-stopped
|
||||
# auth:
|
||||
# depends_on:
|
||||
# db:
|
||||
# condition: service_healthy
|
||||
# healthcheck:
|
||||
# test: ["CMD-SHELL", "curl -fsS http://localhost:${AUTH_DOCKER_PORT}/health || exit 1"]
|
||||
# interval: 10s
|
||||
# timeout: 3s
|
||||
# retries: 10
|
||||
# start_period: 15s
|
||||
# restart: unless-stopped
|
||||
|
||||
db:
|
||||
image: postgres:16
|
||||
# environment:
|
||||
# POSTGRES_DB: ${DB_NAME}
|
||||
# POSTGRES_USER: ${DB_USER}
|
||||
# POSTGRES_PASSWORD: ${DB_PASS}
|
||||
# volumes:
|
||||
# - suitecoffee-db:/var/lib/postgresql/data
|
||||
environment:
|
||||
TZ: America/Montevideo
|
||||
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
|
||||
environment:
|
||||
TZ: America/Montevideo
|
||||
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
|
||||
@ -1,2 +0,0 @@
|
||||
docker compose -f docker-compose.yml -f docker-compose.override.yml \
|
||||
--env-file .env.development up -d
|
||||
Loading…
x
Reference in New Issue
Block a user