mastodon-collector/docker-compose.yml
Pieter 1783a48d7c Initial commit: Mastodon collector application
Add Flask-based application for collecting and archiving Mastodon posts from configured accounts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-09 08:05:54 +01:00

50 lines
1.3 KiB
YAML

version: "3.8"
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: mastodon_collector
POSTGRES_USER: collector
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-collector_secret}
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "127.0.0.1:5434:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U collector -d mastodon_collector"]
interval: 5s
timeout: 5s
retries: 5
web:
build: .
restart: unless-stopped
command: gunicorn --bind 0.0.0.0:5000 --workers 2 --timeout 120 app.web:app
ports:
- "127.0.0.1:8585:5000"
environment:
DATABASE_URL: postgresql://collector:${POSTGRES_PASSWORD:-collector_secret}@db:5432/mastodon_collector
FLASK_SECRET_KEY: ${FLASK_SECRET_KEY:-change-me-in-production}
volumes:
- ./accounts.txt:/app/accounts.txt
depends_on:
db:
condition: service_healthy
collector:
build: .
restart: unless-stopped
command: python -m app.collector
environment:
DATABASE_URL: postgresql://collector:${POSTGRES_PASSWORD:-collector_secret}@db:5432/mastodon_collector
POLL_INTERVAL_SECONDS: ${POLL_INTERVAL_SECONDS:-14400}
volumes:
- ./accounts.txt:/app/accounts.txt
depends_on:
db:
condition: service_healthy
volumes:
pgdata: