mastodon-collector/docker-compose.yml
Pieter 2ff5ed78da Complete toxicity analysis system setup and testing
- Copy and integrate analysis templates from Bluesky collector
- Add template filters (format_number, time_ago, truncate_text)
- Add Analysis link to navigation
- Fix analyzer database schema compatibility (account_db_id, status_type)
- Add OPENAI_API_KEY to docker-compose environment
- Successfully tested analyzer on 100 statuses ($0.0116, 75.4 seconds)

Web interface available at /analysis and /analysis/flagged

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-30 15:39:36 +02:00

51 lines
1.4 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}
OPENAI_API_KEY: ${OPENAI_API_KEY}
volumes:
- ./accounts.txt:/app/accounts.txt
depends_on:
db:
condition: service_healthy
volumes:
pgdata: