Add Docker support with Gunicorn, SQLite volume persistence, and optional PostgreSQL

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Shayan Azadi
2026-07-01 00:32:25 +03:30
parent 066276743a
commit 5dd29c41d6
8 changed files with 151 additions and 3 deletions

View File

@@ -52,3 +52,27 @@ default company settings/account mapping. No demo business data is created.
The frontend logs in via the FunZone admin endpoint
(`/api/auth/token/admin/`) and reuses the returned access token for this service.
Make sure `SECRET_KEY` here is identical to the FunZone backend's.
## Docker
SQLite (default, zero extra services):
```bash
docker compose up -d --build
```
The API listens on **http://localhost:8010** (`/health`, `/api/accounting/...`).
Set `SECRET_KEY` to match the FunZone backend before starting:
```bash
SECRET_KEY=your-shared-secret docker compose up -d --build
```
Optional PostgreSQL instead of SQLite:
```bash
docker compose --profile postgres up -d --build
```
Then set `DATABASE_URL=postgresql://accounting_user:accounting_password@accounting-db:5432/accounting_db` in your environment or `.env` file.