From 687e71be9b2ec14d9960e0fd89be03e8518a316f Mon Sep 17 00:00:00 2001 From: VPS 4 Builder Date: Mon, 18 May 2026 03:48:01 +0200 Subject: [PATCH] chore(newwhats): add newwhats.clube67.com domain mapping to Traefik, Nginx and webhook listener --- clube67/docker-compose.yml | 36 ++++++++++++++++++++++++++++-------- clube67/nginx/default.conf | 2 +- webhook-listener/listener.js | 2 +- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/clube67/docker-compose.yml b/clube67/docker-compose.yml index 030561a..a034841 100644 --- a/clube67/docker-compose.yml +++ b/clube67/docker-compose.yml @@ -6,8 +6,8 @@ services: - "./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro" labels: - "traefik.enable=true" - # Roteador de Produção (clube67.com) - - "traefik.http.routers.clube67-prod.rule=Host(`clube67.com`) || Host(`www.clube67.com`)" + # Roteador de Produção (clube67.com e newwhats.clube67.com) + - "traefik.http.routers.clube67-prod.rule=Host(`clube67.com`) || Host(`www.clube67.com`) || Host(`newwhats.clube67.com`)" - "traefik.http.routers.clube67-prod.entrypoints=websecure" - "traefik.http.routers.clube67-prod.tls.certresolver=le" - "traefik.http.services.clube67-prod.loadbalancer.server.port=80" @@ -20,10 +20,11 @@ services: - newwhats-frontend newwhats-backend: - build: - context: "./newwhats.local/backend" - dockerfile: Dockerfile + image: node:20 + container_name: newwhats-backend-prod restart: always + # rootless docker: container UID 0 já é mapeado para o usuário deploy do host + working_dir: /app env_file: - "./newwhats.local/backend/.env" environment: @@ -39,21 +40,40 @@ services: - "/home/deploy/newwhats-sessions:/app/sessions" - "/home/deploy/newwhats-media:/app/media" - "./newwhats.local/plugins:/app/plugins" + # Montar diretórios e arquivos pré-compilados pelo builder (VPS 4) + - "./newwhats.local/backend/dist:/app/dist" + - "./newwhats.local/backend/package.json:/app/package.json" + - "./newwhats.local/backend/node_modules:/app/node_modules" + - "./newwhats.local/backend/prisma:/app/prisma" + command: node dist/server.js + security_opt: + - no-new-privileges:true networks: - soc - web newwhats-frontend: - build: - context: "./newwhats.local/frontend" - dockerfile: Dockerfile + image: node:20-alpine + container_name: newwhats-frontend-prod restart: always + # rootless docker: container UID 0 já é mapeado para o usuário deploy do host + working_dir: /app env_file: - "./newwhats.local/frontend/.env.production.local" environment: - PORT=3003 - NODE_ENV=production - NEXT_PUBLIC_API_URL=https://clube67.com/api + volumes: + # Montar diretórios e arquivos pré-compilados pelo builder (VPS 4) + - "./newwhats.local/frontend/.next:/app/.next" + - "./newwhats.local/frontend/public:/app/public" + - "./newwhats.local/frontend/next.config.mjs:/app/next.config.mjs" + - "./newwhats.local/frontend/package.json:/app/package.json" + - "./newwhats.local/frontend/node_modules:/app/node_modules" + command: npx next start -p 3003 + security_opt: + - no-new-privileges:true networks: - soc - web diff --git a/clube67/nginx/default.conf b/clube67/nginx/default.conf index 0750072..944a669 100644 --- a/clube67/nginx/default.conf +++ b/clube67/nginx/default.conf @@ -1,6 +1,6 @@ server { listen 80; - server_name clube67.com www.clube67.com; + server_name clube67.com www.clube67.com newwhats.clube67.com; # Limite de upload para mídias do WhatsApp client_max_body_size 100M; diff --git a/webhook-listener/listener.js b/webhook-listener/listener.js index ffb7100..b3ea5ba 100644 --- a/webhook-listener/listener.js +++ b/webhook-listener/listener.js @@ -6,7 +6,7 @@ const fs = require('fs'); const PORT = 9000; const HOST = '10.99.0.4'; const SECRET_TOKEN = 'gitea_webhook_secret_clube67_58e4a92c3d18'; -const SCRIPT_PATH = '/home/deploy/stack/clube67/deploy-prod-builder.sh'; +const SCRIPT_PATH = '/home/deploy/stack/newwhats.clube67.com/deploy-prod-builder.sh'; const LOG_FILE = '/home/deploy/stack/webhook-listener/deploy.log'; const GITEA_API_URL = 'http://10.99.0.3:3000/api/v1'; const GITEA_TOKEN = process.env.GITEA_TOKEN || 'ada47ca2fb196319dd10245cc216a327dac857ec';