This commit is contained in:
@@ -29,6 +29,11 @@ Seed sample articles: `npm run seed` in `backend/`.
|
||||
Environment: `backend/.env` (`PORT=5000`, `MONGO_URI=mongodb://127.0.0.1:27017/mathew`,
|
||||
`JWT_SECRET` — signs session tokens, `AUTH_TOKEN_TTL` — how long one lasts, default `7d`;
|
||||
see `.env.example`). Without `JWT_SECRET` the API warns and uses an insecure dev key.
|
||||
Production (`docker-compose.yml`) runs MongoDB as its own `mongo` service (volume `mongo-data`)
|
||||
and passes the backend a `MONGO_URI` by service name; `JWT_SECRET` interpolates from
|
||||
`/var/www/app/.env` on the deploy host (create it once — the public site must not sign sessions
|
||||
with the dev key). The stack's nginx resolves `backend`/`frontend` through Docker's DNS per
|
||||
request, so container recreates cannot leave it on a stale IP.
|
||||
Frontend API URL comes from `NUXT_PUBLIC_API_BASE`
|
||||
(default `http://localhost:5000`, read via `runtimeConfig.public.apiBase`). The frontend image
|
||||
builds it empty: the browser then calls `/api` on its own origin, which nginx routes to
|
||||
|
||||
Reference in New Issue
Block a user