41 lines
1.1 KiB
Markdown
41 lines
1.1 KiB
Markdown
|
|
## Production deployment
|
|
|
|
Both services build from the repo root (monorepo). The frontend container runs
|
|
nginx, which serves the built SPA at `/` and reverse-proxies `/api` to the
|
|
backend container. Only the frontend port needs to be published — the backend
|
|
is reached internally over the compose network as `backend:8000`.
|
|
|
|
```
|
|
host.com/ -> frontend (nginx static SPA)
|
|
host.com/api/... -> backend (FastAPI, /api prefix stripped)
|
|
```
|
|
|
|
### Build & run
|
|
|
|
```sh
|
|
cp .env.example .env # VITE_API_TARGET (dev proxy only)
|
|
cp ../../backend/.env.example ../../backend/.env # DB creds, API_KEY, etc.
|
|
docker compose -f .build/prod/compose.yml up -d --build
|
|
```
|
|
|
|
The portal is then available on `http://HOST:8000`.
|
|
|
|
### Running from published images
|
|
|
|
```yml
|
|
services:
|
|
backend:
|
|
hostname: backend
|
|
image: git.shihaam.dev/sarlink/radadmin/backend
|
|
env_file:
|
|
- backend.env
|
|
frontend:
|
|
hostname: frontend
|
|
image: git.shihaam.dev/sarlink/radadmin/frontend
|
|
ports:
|
|
- 8000:80
|
|
depends_on:
|
|
- backend
|
|
```
|