- Switch from deb.debian.org to ftp.de.debian.org (33% packet loss observed) - Add APT retry logic (3 attempts) for flaky connections - Fixes deployment timeout on backend build (postgresql-client install) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
842 B
Docker
28 lines
842 B
Docker
FROM python:3.12-slim
|
|
|
|
# Use German mirror for better connectivity and add retry logic
|
|
RUN echo "deb http://ftp.de.debian.org/debian bookworm main" > /etc/apt/sources.list && \
|
|
echo "deb http://ftp.de.debian.org/debian bookworm-updates main" >> /etc/apt/sources.list && \
|
|
echo "Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries
|
|
|
|
# Install PostgreSQL client for psql (needed for startup.sh)
|
|
RUN apt-get update && apt-get install -y postgresql-client && rm -rf /var/lib/apt/lists/*
|
|
|
|
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"]
|