fix: make Evolution CRM and Evolution GO templates respond on their domains

evolutioncrm:
- Point the evo-crm-frontend domain at port 80 instead of 5173: the
  community frontend image serves the built app via nginx on port 80
  (5173 is the vite dev port), so the domain returned 502.
- Set EVOLUTION_API_ONLY_SERVER=true on evo-crm: the community image
  ships without the Rails dashboard views (the UI lives in the separate
  evo-crm-frontend service), so the default root route (dashboard#index)
  can never render and returned 406 for every request. With the flag the
  root serves the API status JSON; all /api routes are unaffected.
- Drop the evolution-go-* volumes that were left over from the other
  template.

evolutiongo:
- Evolution GO has no route on "/" and answers 503 (LICENSE_REQUIRED)
  on API routes until a license is activated through the bundled
  manager UI, so the single domain never responded. Add a small nginx
  gateway that redirects "/" to /manager/login and proxies everything
  else (WebSockets included) 1:1 to evolution-go:8080, and point the
  domain at it.
- Persist /app/dbdata and /app/logs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Mauricio Siu
2026-07-08 01:41:12 -06:00
parent 501d80dcd5
commit 5a6d31c147
4 changed files with 53 additions and 7 deletions

View File

@@ -92,6 +92,7 @@ services:
- BACKEND_URL=${BACK_URL}
- FRONTEND_URL=${FRONT_URL}
- CORS_ORIGINS=${FRONT_URL},${BACK_URL}
- EVOLUTION_API_ONLY_SERVER=true
- DISABLE_TELEMETRY=true
- LOG_LEVEL=info
- ENABLE_ACCOUNT_SIGNUP=true
@@ -248,5 +249,3 @@ volumes:
redis-data:
evo-processor-data:
evo-crm-data:
evolution-go-logs:
evolution-go-data:

View File

@@ -51,7 +51,7 @@ host = "${auth_domain}"
[[config.domains]]
serviceName = "evo-crm-frontend"
port = 5173
port = 80
host = "${front_domain}"

View File

@@ -11,9 +11,20 @@ services:
- DATABASE_SAVE_MESSAGES=${DATABASE_SAVE_MESSAGES}
- WADEBUG=${WADEBUG}
- LOGTYPE=${LOGTYPE}
volumes:
- evolution-go-data:/app/dbdata
- evolution-go-logs:/app/logs
depends_on:
- evolution-postgres
evolution-gateway:
image: nginx:alpine
restart: always
volumes:
- ../files/gateway.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- evolution-go
evolution-postgres:
image: postgres:16-alpine
restart: always
@@ -25,4 +36,6 @@ services:
- evolution-postgres-data:/var/lib/postgresql/data
volumes:
evolution-postgres-data:
evolution-postgres-data:
evolution-go-data:
evolution-go-logs:

View File

@@ -17,9 +17,43 @@ env = [
"POSTGRES_PASSWORD=${postgres_password}",
"DATABASE_CONNECTION_URI=postgres://postgresql:${postgres_password}@evolution-postgres:5432",
]
mounts = []
[[config.mounts]]
filePath = "gateway.conf"
content = """
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name _;
absolute_redirect off;
client_max_body_size 100m;
# Evolution GO has no route on "/" (and the API answers 503 until the
# license is activated), so send visitors to the bundled manager UI.
location = / {
return 302 /manager/login;
}
location / {
proxy_pass http://evolution-go:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
}
}
"""
[[config.domains]]
serviceName = "evolution-go"
port = 8_080
serviceName = "evolution-gateway"
port = 80
host = "${main_domain}"