From 97324d9a0d10ae732f83f5810cf7a4be66db4b3d Mon Sep 17 00:00:00 2001 From: Guilherme Gomes Date: Tue, 14 Apr 2026 17:52:31 -0300 Subject: [PATCH] fix(compose): repair crm healthcheck and inject VITE_* envs into frontend runtime The evo-crm container healthcheck ran curl -f against /auth/sign_in, a legacy Chatwoot endpoint that no longer exists, so the CRM was perpetually marked unhealthy. Any dependent container with a service_healthy condition (notably evo-frontend) then refused to start, freezing make start in a "Waiting" loop. Repointed the healthcheck at /health/live, which the Rails app already exposes and returns 200. The evo-frontend Dockerfile builds the Vite bundle with VITE_*_PLACEHOLDER literals and replaces them at container start via docker-entrypoint.sh using sed on the envs at runtime. The compose file only passed those values as build args, so the runtime envs were empty, the sed was a no-op, and the bundle shipped with raw VITE_AUTH_API_URL_PLACEHOLDER strings. Axios then treated the baseURL as a relative path, POSTs to /auth/sign_in hit the nginx static SPA, and login returned HTTP 405. Added an environment: block that mirrors the build args and also includes VITE_WS_URL (which the actionCableService reads and had no build-time default). Bumps submodule pointers for the four repos touched in this change set. --- docker-compose.yml | 8 +++++++- evo-ai-crm-community | 2 +- evo-ai-frontend-community | 2 +- evo-ai-processor-community | 2 +- evo-auth-service-community | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cb60271..7b0d11a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -125,7 +125,7 @@ services: entrypoint: docker/entrypoints/rails.sh command: ["bundle", "exec", "rails", "s", "-p", "3000", "-b", "0.0.0.0"] healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/auth/sign_in"] + test: ["CMD", "curl", "-f", "http://localhost:3000/health/live"] interval: 30s timeout: 10s retries: 5 @@ -270,6 +270,12 @@ services: VITE_EVOAI_API_URL: ${VITE_EVOAI_API_URL:-http://localhost:5555} VITE_AGENT_PROCESSOR_URL: ${VITE_AGENT_PROCESSOR_URL:-http://localhost:8000} restart: unless-stopped + environment: + VITE_API_URL: ${VITE_API_URL:-http://localhost:3000} + VITE_AUTH_API_URL: ${VITE_AUTH_API_URL:-http://localhost:3001} + VITE_WS_URL: ${VITE_WS_URL:-http://localhost:3000} + VITE_EVOAI_API_URL: ${VITE_EVOAI_API_URL:-http://localhost:5555} + VITE_AGENT_PROCESSOR_URL: ${VITE_AGENT_PROCESSOR_URL:-http://localhost:8000} ports: - "5173:80" depends_on: diff --git a/evo-ai-crm-community b/evo-ai-crm-community index a5dfedc..be18d1b 160000 --- a/evo-ai-crm-community +++ b/evo-ai-crm-community @@ -1 +1 @@ -Subproject commit a5dfedc4df874d95e5bde432ee9730dd49bcc497 +Subproject commit be18d1b8ca58efb2d04de3a95c109e879301a6c0 diff --git a/evo-ai-frontend-community b/evo-ai-frontend-community index ff65ff4..4485997 160000 --- a/evo-ai-frontend-community +++ b/evo-ai-frontend-community @@ -1 +1 @@ -Subproject commit ff65ff4aa12ac12585c854dbc4bd4cba76fec208 +Subproject commit 4485997fedab18df01ca906b20663f6388ddfebc diff --git a/evo-ai-processor-community b/evo-ai-processor-community index 1648f5d..9050693 160000 --- a/evo-ai-processor-community +++ b/evo-ai-processor-community @@ -1 +1 @@ -Subproject commit 1648f5dd492e7d79d80fa2346a162362b9da4a25 +Subproject commit 905069352825ba0f41b8aa66ebbf9c245ef1762a diff --git a/evo-auth-service-community b/evo-auth-service-community index b6fc11a..d01162c 160000 --- a/evo-auth-service-community +++ b/evo-auth-service-community @@ -1 +1 @@ -Subproject commit b6fc11a154171285b64d98a68ce30d006c463ad0 +Subproject commit d01162c81087abe01cc159cf9722185573023773