Backend Dockerfile runs drizzle-kit migrate on start, frontend serves the built Vite app via nginx and proxies /api to the backend container. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TBf3yfnnHzMQ5qhLV2285A
35 lines
1.3 KiB
Markdown
35 lines
1.3 KiB
Markdown
# Deployment
|
|
|
|
## Lokal / Server mit Docker Compose
|
|
|
|
Voraussetzung: Synapse läuft bereits (siehe `synapse/README.md`), Admin-Token liegt vor.
|
|
|
|
```bash
|
|
export DB_PASSWORD=<starkes-passwort>
|
|
export JWT_SECRET=<langer-zufalls-string>
|
|
export APP_BASE_URL=http://localhost:8080
|
|
export SYNAPSE_BASE_URL=http://<synapse-host>:8008
|
|
export SYNAPSE_ADMIN_TOKEN=<token>
|
|
export SYNAPSE_SERVER_NAME=chat.talktime.local
|
|
|
|
docker compose up -d --build
|
|
```
|
|
|
|
Startet:
|
|
- `db` — PostgreSQL 16, Daten in `./pgdata`
|
|
- `backend` — Fastify-API, migriert die DB beim Start automatisch (`drizzle-kit migrate`), Port 4000
|
|
- `frontend` — gebautes Vite-Frontend hinter nginx, proxied `/api/*` zu `backend:4000`, Port 8080
|
|
|
|
App danach unter `http://localhost:8080` erreichbar.
|
|
|
|
## Produktivbetrieb
|
|
|
|
- Reverse Proxy (nginx/Caddy) terminiert TLS vor Port 8080 (frontend) und ggf. Synapse (8008/8448) — Ports nicht direkt exponieren.
|
|
- `.env`-Datei statt `export` nutzen (nicht committen), Secrets nie in Git.
|
|
- Backups: `pgdata/`-Volume (App-DB) und Synapse-eigene Postgres-DB regelmäßig sichern (`pg_dump`).
|
|
- Updates: `git pull && docker compose up -d --build`.
|
|
|
|
## Environment-Variablen (Backend)
|
|
|
|
Siehe `backend/.env.example` für die vollständige Liste (lokal ohne Docker) bzw. oben für Compose.
|