A third party ATProto appview
1# Unified Python Worker Dockerfile
2# Replaces 32 TypeScript workers with a single Python process
3
4FROM python:3.11-slim
5
6WORKDIR /app
7
8# Install system dependencies
9RUN apt-get update && apt-get install -y \
10 gcc \
11 postgresql-client \
12 && rm -rf /var/lib/apt/lists/*
13
14# Copy requirements and install dependencies
15COPY requirements.txt .
16RUN pip install --no-cache-dir -r requirements.txt
17
18# Copy unified worker and related services
19COPY unified_worker.py .
20COPY backfill_service.py .
21COPY did_resolver.py .
22COPY pds_data_fetcher.py .
23COPY label_service.py .
24COPY verify_code.py .
25
26# Set environment defaults
27ENV RELAY_URL=wss://bsky.network
28ENV DATABASE_URL=postgresql://postgres:password@db:5432/atproto
29ENV DB_POOL_SIZE=20
30ENV LOG_LEVEL=INFO
31ENV PYTHONDONTWRITEBYTECODE=1
32
33# Health check
34HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
35 CMD python -c "import asyncpg; import asyncio; asyncio.run(asyncpg.connect('${DATABASE_URL}', timeout=5).close())" || exit 1
36
37# Run unified worker
38CMD ["python", "-u", "unified_worker.py"]