diff --git a/README.md b/README.md index 1956891..c48bcdb 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,44 @@ npm run dev docker compose up -d ``` +## Deployment + +**Production URL:** [https://comparaison.local.tophermayor.com](https://comparaison.local.tophermayor.com) + +| Detail | Value | +|---|---| +| Host | `ubuntu` (`192.168.50.61`) | +| Compose file | `/srv/compose/comparaison/docker-compose.yml` | +| Reverse proxy | Traefik (shared instance on `proxy-net`) | +| Database | Shared PostgreSQL (`postgres-shared` container on `proxy-net`) | +| Routing | Docker labels on the app container (Traefik router/rules) | + +### Production Setup + +1. **Traefik Ingress** — A shared Traefik instance handles TLS termination and routes traffic to the app container via Docker labels. The app joins the `proxy-net` network so Traefik can reach it. + +2. **Shared PostgreSQL** — A standalone `postgres-shared` container provides the database. The comparaison app connects to it over `proxy-net`. No separate DB container is defined in the app's compose file. + +3. **Environment** — The following are configured in the production environment: + - `DATABASE_URL` — Points to the shared Postgres instance + - `BETTER_AUTH_SECRET` — Random secret for session signing + - `OPENAI_API_KEY`, `TAVILY_API_KEY`, `PERPLEXITY_API_KEY` — LLM provider keys + - `NEXT_PUBLIC_APP_URL` — `https://comparaison.local.tophermayor.com` + +### Deploying Updates + +```bash +# On ubuntu (192.168.50.61) +cd /srv/compose/comparaison +docker compose pull && docker compose up -d +``` + +### Recent Fixes + +- Added `userId` to comparison inserts so saved comparisons are properly associated with authenticated users +- Fixed OpenAI provider `getClient()` to correctly initialize the OpenAI client +- Added `BETTER_AUTH_SECRET` to production environment for proper session management + ## Project Structure ```