diff --git a/blueprints/evolutioncrm/docker-compose.yml b/blueprints/evolutioncrm/docker-compose.yml index ab1da2d5..50a37b8b 100644 --- a/blueprints/evolutioncrm/docker-compose.yml +++ b/blueprints/evolutioncrm/docker-compose.yml @@ -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: diff --git a/blueprints/evolutioncrm/template.toml b/blueprints/evolutioncrm/template.toml index 90a6c36d..a81c5e4e 100644 --- a/blueprints/evolutioncrm/template.toml +++ b/blueprints/evolutioncrm/template.toml @@ -51,7 +51,7 @@ host = "${auth_domain}" [[config.domains]] serviceName = "evo-crm-frontend" -port = 5173 +port = 80 host = "${front_domain}" diff --git a/blueprints/evolutiongo/docker-compose.yml b/blueprints/evolutiongo/docker-compose.yml index 062709eb..2ad80181 100644 --- a/blueprints/evolutiongo/docker-compose.yml +++ b/blueprints/evolutiongo/docker-compose.yml @@ -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: \ No newline at end of file + evolution-postgres-data: + evolution-go-data: + evolution-go-logs: diff --git a/blueprints/evolutiongo/template.toml b/blueprints/evolutiongo/template.toml index c178703a..37957061 100644 --- a/blueprints/evolutiongo/template.toml +++ b/blueprints/evolutiongo/template.toml @@ -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}"