docs: add Coolify deployment instructions to README

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Timo Uttenweiler
2026-03-17 11:21:42 +01:00
parent facf8c9f69
commit aa50f46748

View File

@@ -122,6 +122,42 @@ npx prisma studio
--- ---
## Deploy with Coolify (Docker)
### 1. Add the Gitea repo in Coolify
- New Resource → Application → Docker Compose (or Dockerfile)
- Repository: `https://gitea.onyva.dev/TimoUttenweiler/lead-scraper`
- Branch: `main`
- Build method: **Dockerfile** (recommended) or **Docker Compose**
### 2. Set environment variables in Coolify
In the app's Environment Variables tab:
| Variable | Value |
|---|---|
| `APP_ENCRYPTION_SECRET` | Any random 32-character string (generate once, keep secret) |
| `DATABASE_URL` | `file:/data/leadflow.db` |
| `NODE_ENV` | `production` |
| `PORT` | `3000` |
### 3. Add a persistent volume
- Mount path in container: `/data`
- This stores the SQLite database across deployments
### 4. Port mapping
- Container port: `3000`
- Coolify will proxy via its reverse proxy automatically
### 5. Deploy
Click Deploy — Coolify builds the image from the Dockerfile, migrations run automatically on startup via `docker-entrypoint.sh`.
### Dockerfile stages
1. **deps**`npm ci` + native build tools for better-sqlite3
2. **builder** — Prisma generate + `next build` (standalone output)
3. **runner** — minimal Alpine image, non-root user, copies only what's needed
---
## Troubleshooting ## Troubleshooting
| Issue | Solution | | Issue | Solution |