Deployement demo - #140
Conversation
- single docker-compose.yaml prod-ready (no host ports, Traefik labels) - removed docker-compose.override.yaml (consolidated) - .env.example reduced to deploy-relevant variables - ARIA_MCP_PUBLIC_URL auto-built from BACKEND_HOST + ARIA_MCP_PATH_SECRET - CORS_ORIGINS scoped to FRONTEND_HOST - backend uvicorn uses --proxy-headers for Traefik
There was a problem hiding this comment.
Pull request overview
Converts the existing dev-oriented docker-compose.yml and .env.example into a "production" deployment targeting Dokploy + Traefik + Let's Encrypt: removes host port bindings, drops the Cloudflare tunnel side-car, adds Traefik labels for the backend (BACKEND_HOST) and frontend (FRONTEND_HOST) on an external dokploy-network, and rewrites the env template around two public hostnames plus auto-derived MCP URL / CORS origins. .gitignore also adds graphify-out/.
Changes:
- Replace host-port + bind-mount dev setup with Traefik-labelled services on
dokploy-network, removing thetunnelservice and allcontainer_namefields. - Switch backend to
--proxy-headers --forwarded-allow-ips=*, deriveARIA_MCP_PUBLIC_URLfromBACKEND_HOST+ path secret, and pin CORS tohttps://${FRONTEND_HOST}. - Rewrite
.env.examplearoundFRONTEND_HOST/BACKEND_HOST, defaultINVESTIGATOR_USE_MANAGED=trueandARIA_DEMO_ENABLED=true, dropPOSTGRES_PORT,BACKEND_PORT,FRONTEND_PORT,VITE_API_BASE_URL,CF_TUNNEL_TOKEN, andSIMULATOR_SCENARIO.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docker-compose.yml | Production-style Traefik wiring; removes host ports/dev bind-mounts; frontend still runs Vite dev server; new MCP URL + CORS interpolation; new external dokploy-network. |
| .env.example | Simplified production template; new FRONTEND_HOST/BACKEND_HOST; defaults INVESTIGATOR_USE_MANAGED=true, ARIA_DEMO_ENABLED=true; removes dev/port/tunnel/scenario variables. |
| .gitignore | Ignore the per-developer graphify-out/ knowledge-graph directory. |
Comments suppressed due to low confidence (5)
docker-compose.yml:175
- The frontend uses relative URLs (
/api/v1/...viaapiFetchinfrontend/src/lib/api/api.client.tsand the WebSocket clients infrontend/src/features/**/use*Stream.ts). In this production setupFRONTEND_HOST(aria.vgtray.fr) andBACKEND_HOST(aria-backend.vgtray.fr) are different Traefik routers, and the frontend router ruleHost(\${FRONTEND_HOST}`)catches every path on the frontend host — including/api/v1/.... As a result, browser API/WebSocket calls hit the Vite container, which returns the SPA HTML/404 for those paths instead of the backend. Either (a) add a Traefik router onFRONTEND_HOSTwith aPathPrefix(`/api`)(and/wsif used) rule pointing ataria-backend, or (b) wire the frontend to actually use an absolute base URL pointing atBACKEND_HOST. TheVITE_API_URL/VITE_API_BASE_URLenvironment variables added here are never read infrontend/src(noimport.meta.env.VITE_API_*` usage), so they have no effect today. As-is, the deployed app will not be able to talk to the backend.
docker-compose.yml:175 - The frontend service is being deployed as a Vite dev server (
frontend/Dockerfileends withCMD ["npm", "run", "dev"]and Traefik routes port 5173). This compose file is labelled "Production compose (Dokploy + Traefik + Let's Encrypt)", but the dev server is not intended for production use: it is unoptimized (no minification, no code splitting tuned for prod, large bundles), has no HMR security model for public exposure, depends on Vite's CORS/host-check behaviour (the public host must be inserver.allowedHosts/server.hostconfig, otherwise Vite refuses requests), and serves source maps and source files. The Dockerfile should be switched to a multi-stage build that runsnpm run buildand serves the staticdist/via nginx orvite preview, or the deployment should otherwise not rely onnpm run devfor production traffic.
docker-compose.yml:165 VITE_API_BASE_URLandVITE_API_URLare set underenvironment:, but no code infrontend/srcreferencesimport.meta.env.VITE_API_BASE_URLorVITE_API_URL(the API client hard-codes the relativePREFIX = "/api/v1"). Additionally, Vite only inlinesVITE_*variables at build time — for a production build they would need to be passed as build args, not runtime environment. Either drop these variables (they are dead) or actually consume them in the frontend code and propagate them through the Docker build.
This issue also appears on line 164 of the same file.
docker-compose.yml:143
ARIA_MCP_PATH_SECRETis interpolated into a Traefik-exposed URL stored inARIA_MCP_PUBLIC_URL. The whole point of the path secret (seebackend/agents/investigator/managed/bootstrap.py) is that "the URL itself IS the secret". Make sure the deployment is aware that this URL will end up in process listings, container introspection (docker inspect), Dokploy UI, and any logs that echo it. If a deployment ever logs the request URL (Traefik access logs, FastAPI access logs), the secret leaks. Consider documenting this trade-off in.env.examplenext toARIA_MCP_PATH_SECRET, and confirm access logging is configured to redact/mcp/<secret>/paths.
docker-compose.yml:144CORS_ORIGINSis set to["https://${FRONTEND_HOST}"], which is correct for browser→backend XHR. However, because frontend and backend are now on different subdomains, the backend auth cookies (access_token,refresh_token) must be issued withSameSite=None; Secureand credentialed CORS must be enabled (Access-Control-Allow-Credentials: true) for them to be sent from the frontend origin. Please verifycore/security/cookies.pycookie attributes and the FastAPI CORS middlewareallow_credentials=Trueconfiguration are compatible with this cross-site setup; otherwise login will silently fail in production even though the same code works in dev (where both run onlocalhost).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # CF_TUNNEL_TOKEN= | ||
| # --- Demo --- | ||
| # Exposes the demo control endpoints (scenario triggers). Off in real prod. | ||
| ARIA_DEMO_ENABLED=true |
| POSTGRES_USER=aria | ||
| POSTGRES_PASSWORD=aria_dev_password | ||
| POSTGRES_PASSWORD=change-me-strong-password | ||
| POSTGRES_DB=aria |
| # on its own; only useful for a long-running self-running demo. | ||
| # --- Simulators --- | ||
| # realtime : 1 simulated sec = 1 real sec, cells idle near nominal. | ||
| # demo : compress 72h scenario into ~4 minutes (Filler breaches alone). |
|
Salut Adam, J'ai dû revert ta PR #140 ( Le souci c'est que la PR a été mergée telle quelle alors qu'elle casse complètement le workflow dev local et plusieurs choses référencées partout dans le repo. En l'état, plus personne ne peut faire tourner Aria en local. Ce qui est cassé :
Ce qu'il faut faire à la place (si tu retravailles la PR) :
|
|
Hello, T'as raison my bad ! La PR aurait dû rester sur ma deuxième branche deploy je pensais qu'on pouvais merge tranquille mais non (vgtray/Aria) — j'avais en tête le deploy Dokploy perso, mais c'était à séparer quand même finalement. Je vais réécrire ça autrement sur la deuxième branche de déploy
|
No description provided.