FROM python:3.11-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ gcc \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for better caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Install additional dependencies needed for production RUN pip install --no-cache-dir asyncpg python-dotenv # Copy application code COPY src/ ./src/ COPY config/ ./config/ COPY migrations/ ./migrations/ COPY alembic.ini ./ # Create logs directory RUN mkdir -p logs # Set Python path ENV PYTHONPATH=/app/src # Run the application CMD ["python", "-m", "src.main"]