docs: add production deployment guide (Dokploy)
- new DEPLOYMENT.md: security model, env vars, first deploy, DB reset - README: clarify demo accounts are dev-only, link to DEPLOYMENT.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
41
README.md
41
README.md
@@ -64,9 +64,12 @@ npm run dev
|
||||
|
||||
Frontend will be available at: http://localhost:5173
|
||||
|
||||
## Demo Accounts
|
||||
## Demo Accounts (local dev only)
|
||||
|
||||
After seeding the database (runs automatically on container start):
|
||||
Demo accounts are **not** created in production. They are seeded only for local
|
||||
development, and only when `RUN_SEED=1` is set (see `backend/.env.example`).
|
||||
In production, the first user to register becomes the `superadmin` — see
|
||||
[DEPLOYMENT.md](DEPLOYMENT.md).
|
||||
|
||||
| Email | Password | Role |
|
||||
|-------|----------|------|
|
||||
@@ -74,6 +77,9 @@ After seeding the database (runs automatically on container start):
|
||||
| manager@example.com | managerpassword | Manager |
|
||||
| user@example.com | userpassword | User |
|
||||
|
||||
> Passwords are overridable via `ADMIN_PASSWORD` / `MANAGER_PASSWORD` /
|
||||
> `USER_PASSWORD`. Defaults are weak and for local use only.
|
||||
|
||||
## Docker Compose (local)
|
||||
|
||||
```bash
|
||||
@@ -90,29 +96,20 @@ Backend API: http://localhost:8000/docs
|
||||
|
||||
## Deploy (Dokploy)
|
||||
|
||||
```
|
||||
Dokploy UI → New Service → Docker Compose → Git: space-booking repo
|
||||
```
|
||||
See **[DEPLOYMENT.md](DEPLOYMENT.md)** for the full production guide (security
|
||||
model, environment variables, first-deploy steps, and how to reset the
|
||||
database).
|
||||
|
||||
### Environment Variables (Dokploy → Environment tab)
|
||||
Quick version:
|
||||
|
||||
| Variable | Required | Example |
|
||||
|----------|----------|---------|
|
||||
| `SECRET_KEY` | **Yes** | `python -c "import secrets; print(secrets.token_hex(32))"` |
|
||||
| `FRONTEND_URL` | **Yes** | `https://space.roa.romfast.ro` |
|
||||
| `SMTP_ENABLED` | No | `true` |
|
||||
| `SMTP_HOST` | No* | `smtp.example.com` |
|
||||
| `SMTP_PORT` | No* | `587` |
|
||||
| `SMTP_USER` | No* | `user@example.com` |
|
||||
| `SMTP_PASSWORD` | No* | `secret` |
|
||||
| `SMTP_FROM_ADDRESS` | No* | `rezervari@romfast.ro` |
|
||||
1. `Dokploy UI → New Service → Docker Compose → Git: space-booking repo`
|
||||
2. Set environment variables (`SECRET_KEY`, `FRONTEND_URL`, `DOMAIN`).
|
||||
3. Deploy. Tables are auto-created on boot; **no demo data** is seeded.
|
||||
4. Open the site → **Register your own account first** → you become
|
||||
`superadmin`.
|
||||
|
||||
*Required only if `SMTP_ENABLED=true`
|
||||
|
||||
### Auto-seed
|
||||
|
||||
`entrypoint.sh` runs `seed_db.py` automatically on every container start.
|
||||
The script is idempotent — skips if data already exists.
|
||||
> The backend refuses to start in production unless `SECRET_KEY` is a strong,
|
||||
> random value. Do not set `RUN_SEED` in production.
|
||||
|
||||
## Development Commands
|
||||
|
||||
|
||||
Reference in New Issue
Block a user