This commit is contained in:
+33
-9
@@ -1,16 +1,40 @@
|
||||
|
||||
## Production deployment
|
||||
it is assumed that you will be using backend on the same machine, so this compose is for both services
|
||||
|
||||
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:
|
||||
frontend:
|
||||
hostname: frontend
|
||||
image: git.shihaam.dev/sarlink/radui
|
||||
ports:
|
||||
- 8000:80
|
||||
backend:
|
||||
hostname: backend
|
||||
image: git.shihaam.dev/sarlink/radapi
|
||||
ports:
|
||||
- 8001:80
|
||||
image: git.shihaam.dev/sarlink/radadmin/backed
|
||||
env_file:
|
||||
- backend.env
|
||||
frontend:
|
||||
hostname: frontend
|
||||
image: git.shihaam.dev/sarlink/radadmin/frontend
|
||||
ports:
|
||||
- 8000:80
|
||||
depends_on:
|
||||
- backend
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user