Add production Dockerfile for backend deployment

This commit is contained in:
Chris
2026-04-03 03:11:28 +08:00
parent a187acf58c
commit 75cf22f7e5
3 changed files with 55 additions and 0 deletions

View File

@@ -12,6 +12,29 @@ psql "$DATABASE_URL" -f scripts/init_schema.sql
./scripts/start_dev.sh
```
## Docker (VPS / Production)
Build image:
```bash
cd backend
docker build -t memberapi-backend:latest .
```
Run container:
```bash
docker run -d \
--name memberapi-backend \
--restart unless-stopped \
-p 127.0.0.1:8000:8000 \
--env-file .env \
memberapi-backend:latest
```
Health check:
```bash
curl http://127.0.0.1:8000/healthz
```
## Keycloak env
- Required: