fix: simplify docker-compose to non-Swarm mode (match whatsapp-api pattern)

Remove external network and Swarm deploy labels; use expose + service-level
Traefik labels like the existing whatsapp-api container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 17:00:07 -03:00
parent 995f211288
commit c5bfda5918
+14 -38
View File
@@ -1,48 +1,24 @@
version: '3.8'
services: services:
api_zdg_oficial: whatsapp-api-oficial:
image: chrishubert/whatsapp-oficial-api:latest build: .
build: image: whatsapp-api-oficial:latest
context: . container_name: whatsapp-api-oficial
dockerfile: Dockerfile restart: unless-stopped
networks: env_file:
- comunidadezdg - .env
volumes: volumes:
- api_zdg_oficial_data:/usr/src/app/data - api_zdg_oficial_data:/usr/src/app/data
environment: expose:
- PORT=3001 - "3001"
- API_KEY=${API_KEY}
- BASE_WEBHOOK_URL=${BASE_WEBHOOK_URL}
- META_WEBHOOK_VERIFY_TOKEN=${META_WEBHOOK_VERIFY_TOKEN}
- ENABLE_SWAGGER_ENDPOINT=TRUE
- DB_PATH=/usr/src/app/data/accounts.db
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
resources:
limits:
cpus: "0.5"
memory: 256M
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.http.routers.api_zdg_oficial.rule=Host(`apimsgoficial.neuralsys.com.br`) - traefik.http.routers.whatsapp-api-oficial.rule=Host(`apimsgoficial.neuralsys.com.br`)
- traefik.http.routers.api_zdg_oficial.entrypoints=websecure - traefik.http.routers.whatsapp-api-oficial.entrypoints=websecure
- traefik.http.routers.api_zdg_oficial.tls.certresolver=letsencryptresolver - traefik.http.routers.whatsapp-api-oficial.tls=true
- traefik.http.routers.api_zdg_oficial.priority=1 - traefik.http.routers.whatsapp-api-oficial.tls.certresolver=letsencrypt
- traefik.http.routers.api_zdg_oficial.service=api_zdg_oficial - traefik.http.services.whatsapp-api-oficial.loadbalancer.server.port=3001
- traefik.http.services.api_zdg_oficial.loadbalancer.server.port=3001
- traefik.http.services.api_zdg_oficial.loadbalancer.passHostHeader=true
volumes: volumes:
api_zdg_oficial_data: api_zdg_oficial_data:
external: true external: true
name: api_zdg_oficial_data name: api_zdg_oficial_data
networks:
comunidadezdg:
name: comunidadezdg
external: true