diff --git a/compose.dbeaver.yaml b/compose.dbeaver.yaml deleted file mode 100644 index d035577..0000000 --- a/compose.dbeaver.yaml +++ /dev/null @@ -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: \ No newline at end of file diff --git a/compose.dev.yaml b/compose.dev.yaml index 1c093c5..9b6aee1 100644 --- a/compose.dev.yaml +++ b/compose.dev.yaml @@ -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: diff --git a/compose.npm.yaml b/compose.npm.yaml deleted file mode 100644 index 571c191..0000000 --- a/compose.npm.yaml +++ /dev/null @@ -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: diff --git a/compose.prod.yaml b/compose.prod.yaml index cead144..3489b9a 100644 --- a/compose.prod.yaml +++ b/compose.prod.yaml @@ -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 @@ -49,14 +33,7 @@ services: - ./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 + command: npm run start 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: diff --git a/compose.tools.yaml b/compose.tools.yaml new file mode 100644 index 0000000..49fd8d2 --- /dev/null +++ b/compose.tools.yaml @@ -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: diff --git a/compose.yaml b/compose.yaml index 01bf5ef..85659b6 100644 --- a/compose.yaml +++ b/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 \ No newline at end of file + restart: unless-stopped \ No newline at end of file diff --git a/myREADME.md b/myREADME.md deleted file mode 100644 index 54a71d9..0000000 --- a/myREADME.md +++ /dev/null @@ -1,2 +0,0 @@ -docker compose -f docker-compose.yml -f docker-compose.override.yml \ ---env-file .env.development up -d \ No newline at end of file