feat: docker-compose + .env.example + postgresql.conf + updated README

This commit is contained in:
2026-06-16 19:16:08 +02:00
parent fbbdc5e54b
commit 7c9db4d705
4 changed files with 178 additions and 11 deletions
+40 -11
View File
@@ -4,16 +4,53 @@ Telegram bot + scraper for willhaben.at classified ads. Self-hosted on Unraid vi
## Stack
- **Postgres 15** with Supabase (PostgREST, Kong)
- **Postgres 15** with logical WAL, init scripts run alphabetically on first boot
- **PostgREST** — auto-generated REST API over Postgres `public` schema
- **Kong** — reverse proxy routing `/rest/v1/` to PostgREST
- **Supabase Studio** — database browser and management UI
- **Python worker** — Telegram long polling + scrape scheduler
- **Docker Compose** deployed via Portainer at `/mnt/user/appdata/willhaben-tracker`
## Services
| Service | Image | Port | Description |
|---------|-------|------|-------------|
| db | postgres:15-alpine | `55632` | PostgreSQL with init migrations |
| rest | postgrest/postgrest:v12.2.0 | internal | REST API over Postgres |
| kong | kong:2.8.1 | `55621` | API gateway / reverse proxy |
| studio | supabase/studio | `55630` | Supabase dashboard UI |
| meta | supabase/postgres-meta:v0.84.2 | internal | Database introspection for Studio |
| worker | custom (./worker) | none | Bot + scraper process |
## Quick Start
```bash
cp .env.example .env
# Edit TELEGRAM_BOT_TOKEN and POSTGRES_PASSWORD in .env
docker compose up -d
docker compose up -d --build
```
On first boot, Postgres init scripts run automatically in order:
1. `00-run-init.sh` — creates roles (authenticator, dashboard_user)
2. `01-init.sql` — creates tables and indexes
3. `post-boot.sql` — applies grants on created tables
## Deployment
### Unraid + Portainer
1. Set the Docker Compose project path to `/mnt/user/appdata/willhaben-tracker`
2. Ensure `.env` is present with valid credentials
3. Deploy via Portainer: **Stacks → Add stack**, paste `docker-compose.yml` contents and attach `.env`
4. Postgres data persists at `/mnt/user/appdata/willhaben-tracker/data/db`
### Manual (Linux)
```bash
cd /path/to/willhaben-tracker
cp .env.example .env
# Edit .env with your credentials
docker compose up -d --build
```
## Telegram Commands
@@ -24,11 +61,3 @@ docker compose up -d
- `/pause <id>` / `/resume <id>` — Toggle query
- `/delete <id>` — Remove query
- `/stats` — Tracking statistics
## Ports
| Service | Port |
|---------|------|
| Kong API | `55621` |
| Studio | `55630` |
| Postgres | `55632` |