- Remove postgresql-client installation (causes 150s+ hangs due to network) - Add db_init.py: Pure Python PostgreSQL checks using psycopg2-binary - Simplify startup.sh: Call Python script instead of psql commands - Build should now complete in <30s instead of hanging This fixes the deployment timeout issue by avoiding APT network problems entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
453 B
Docker
22 lines
453 B
Docker
FROM python:3.12-slim
|
|
|
|
# No system packages needed - we use Python (psycopg2-binary) for PostgreSQL checks
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Python dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY . .
|
|
|
|
# Create directories
|
|
RUN mkdir -p /app/data /app/photos
|
|
|
|
# Make startup script executable
|
|
RUN chmod +x /app/startup.sh
|
|
|
|
# Use startup script instead of direct uvicorn
|
|
CMD ["/app/startup.sh"]
|