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:
|
services:
|
||||||
|
|
||||||
app:
|
app:
|
||||||
# depends_on:
|
|
||||||
# db:
|
|
||||||
# condition: service_healthy
|
|
||||||
# tenants:
|
|
||||||
# condition: service_healthy
|
|
||||||
image: node:20-bookworm
|
image: node:20-bookworm
|
||||||
expose:
|
expose:
|
||||||
- ${APP_LOCAL_PORT}
|
- ${APP_LOCAL_PORT}
|
||||||
@ -22,14 +17,6 @@ services:
|
|||||||
- ./services/app/.env.development
|
- ./services/app/.env.development
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=${NODE_ENV}
|
- 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:
|
networks:
|
||||||
net:
|
net:
|
||||||
aliases: [dev-app]
|
aliases: [dev-app]
|
||||||
@ -37,9 +24,6 @@ services:
|
|||||||
|
|
||||||
auth:
|
auth:
|
||||||
image: node:20-bookworm
|
image: node:20-bookworm
|
||||||
# depends_on:
|
|
||||||
# db:
|
|
||||||
# condition: service_healthy
|
|
||||||
expose:
|
expose:
|
||||||
- ${AUTH_LOCAL_PORT}
|
- ${AUTH_LOCAL_PORT}
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
@ -52,13 +36,6 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- NODE_ENV=${NODE_ENV}
|
- NODE_ENV=${NODE_ENV}
|
||||||
command: npm run dev
|
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:
|
networks:
|
||||||
net:
|
net:
|
||||||
aliases: [dev-auth]
|
aliases: [dev-auth]
|
||||||
@ -71,16 +48,9 @@ services:
|
|||||||
POSTGRES_PASSWORD: ${DB_PASS}
|
POSTGRES_PASSWORD: ${DB_PASS}
|
||||||
volumes:
|
volumes:
|
||||||
- suitecoffee-db:/var/lib/postgresql/data
|
- 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:
|
networks:
|
||||||
net:
|
net:
|
||||||
aliases: [dev-db]
|
aliases: [dev-db]
|
||||||
# restart: unless-stopped
|
|
||||||
|
|
||||||
tenants:
|
tenants:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
@ -90,16 +60,9 @@ services:
|
|||||||
POSTGRES_PASSWORD: ${TENANTS_DB_PASS}
|
POSTGRES_PASSWORD: ${TENANTS_DB_PASS}
|
||||||
volumes:
|
volumes:
|
||||||
- tenants-db:/var/lib/postgresql/data
|
- 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:
|
networks:
|
||||||
net:
|
net:
|
||||||
aliases: [dev-tenants]
|
aliases: [dev-tenants]
|
||||||
# restart: unless-stopped
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
tenants-db:
|
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:
|
services:
|
||||||
|
|
||||||
app:
|
app:
|
||||||
# depends_on:
|
|
||||||
# db:
|
|
||||||
# condition: service_healthy
|
|
||||||
# tenants:
|
|
||||||
# condition: service_healthy
|
|
||||||
build:
|
build:
|
||||||
context: ./services/app
|
context: ./services/app
|
||||||
dockerfile: Dockerfile.production
|
dockerfile: Dockerfile.production
|
||||||
@ -21,23 +16,12 @@ services:
|
|||||||
- ./services/app/.env.production
|
- ./services/app/.env.production
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=${NODE_ENV}
|
- 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:
|
networks:
|
||||||
net:
|
net:
|
||||||
aliases: [prod-app]
|
aliases: [prod-app]
|
||||||
command: npm run start
|
command: npm run start
|
||||||
|
|
||||||
auth:
|
auth:
|
||||||
# depends_on:
|
|
||||||
# db:
|
|
||||||
# condition: service_healthy
|
|
||||||
build:
|
build:
|
||||||
context: ./services/auth
|
context: ./services/auth
|
||||||
dockerfile: Dockerfile.production
|
dockerfile: Dockerfile.production
|
||||||
@ -49,14 +33,7 @@ services:
|
|||||||
- ./services/auth/.env.production
|
- ./services/auth/.env.production
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=${NODE_ENV}
|
- NODE_ENV=${NODE_ENV}
|
||||||
command: npm run start
|
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:
|
networks:
|
||||||
net:
|
net:
|
||||||
aliases: [prod-auth]
|
aliases: [prod-auth]
|
||||||
@ -69,16 +46,9 @@ services:
|
|||||||
POSTGRES_PASSWORD: ${DB_PASS}
|
POSTGRES_PASSWORD: ${DB_PASS}
|
||||||
volumes:
|
volumes:
|
||||||
- suitecoffee-db:/var/lib/postgresql/data
|
- 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:
|
networks:
|
||||||
net:
|
net:
|
||||||
aliases: [prod-db]
|
aliases: [prod-db]
|
||||||
# restart: unless-stopped
|
|
||||||
|
|
||||||
tenants:
|
tenants:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
@ -88,16 +58,9 @@ services:
|
|||||||
POSTGRES_PASSWORD: ${TENANTS_DB_PASS}
|
POSTGRES_PASSWORD: ${TENANTS_DB_PASS}
|
||||||
volumes:
|
volumes:
|
||||||
- tenants-db:/var/lib/postgresql/data
|
- 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:
|
networks:
|
||||||
net:
|
net:
|
||||||
aliases: [prod-tenants]
|
aliases: [prod-tenants]
|
||||||
# restart: unless-stopped
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
tenants-db:
|
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:
|
||||||
111
compose.yaml
111
compose.yaml
@ -4,105 +4,52 @@ name: ${COMPOSE_PROJECT_NAME:-suitecoffee}
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
app:
|
# app:
|
||||||
depends_on:
|
# depends_on:
|
||||||
db:
|
# db:
|
||||||
condition: service_healthy
|
# condition: service_healthy
|
||||||
tenants:
|
# tenants:
|
||||||
condition: service_healthy
|
# condition: service_healthy
|
||||||
# build:
|
# healthcheck:
|
||||||
# context: ./services/app
|
# test: ["CMD-SHELL", "curl -fsS http://localhost:${APP_DOCKER_PORT}/health || exit 1"]
|
||||||
# dockerfile: Dockerfile.production
|
# interval: 10s
|
||||||
# expose:
|
# timeout: 3s
|
||||||
# - ${APP_LOCAL_PORT}
|
# retries: 10
|
||||||
# volumes:
|
# start_period: 20s
|
||||||
# - ./services/app:/app
|
# restart: unless-stopped
|
||||||
# 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
|
|
||||||
|
|
||||||
auth:
|
# auth:
|
||||||
depends_on:
|
# depends_on:
|
||||||
db:
|
# db:
|
||||||
condition: service_healthy
|
# condition: service_healthy
|
||||||
# build:
|
# healthcheck:
|
||||||
# context: ./services/auth
|
# test: ["CMD-SHELL", "curl -fsS http://localhost:${AUTH_DOCKER_PORT}/health || exit 1"]
|
||||||
# dockerfile: Dockerfile.production
|
# interval: 10s
|
||||||
# expose:
|
# timeout: 3s
|
||||||
# - ${AUTH_LOCAL_PORT}
|
# retries: 10
|
||||||
# volumes:
|
# start_period: 15s
|
||||||
# - ./services/auth:/app
|
# restart: unless-stopped
|
||||||
# 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
|
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
# environment:
|
environment:
|
||||||
# POSTGRES_DB: ${DB_NAME}
|
TZ: America/Montevideo
|
||||||
# POSTGRES_USER: ${DB_USER}
|
|
||||||
# POSTGRES_PASSWORD: ${DB_PASS}
|
|
||||||
# volumes:
|
|
||||||
# - suitecoffee-db:/var/lib/postgresql/data
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 20
|
retries: 20
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
# networks:
|
|
||||||
# net:
|
|
||||||
# aliases: [prod-db]
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
tenants:
|
tenants:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
# environment:
|
environment:
|
||||||
# POSTGRES_DB: ${TENANTS_DB_NAME}
|
TZ: America/Montevideo
|
||||||
# POSTGRES_USER: ${TENANTS_DB_USER}
|
|
||||||
# POSTGRES_PASSWORD: ${TENANTS_DB_PASS}
|
|
||||||
# volumes:
|
|
||||||
# - tenants-db:/var/lib/postgresql/data
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${TENANTS_DB_USER} -d ${TENANTS_DB_NAME}"]
|
test: ["CMD-SHELL", "pg_isready -U ${TENANTS_DB_USER} -d ${TENANTS_DB_NAME}"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 20
|
retries: 20
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
# networks:
|
restart: unless-stopped
|
||||||
# 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