Files
petpicturequeue/Dockerfile
Ryan Chen b71187009b feat: update Docker setup for refactored app structure
- Update Dockerfile to copy new app/ directory structure
- Fix docker-compose.yml volume paths for app/static/uploads
- Add environment variable support for new config system
- Update migration service to use migrate_session_changes.py
- Add .dockerignore for optimized builds
- Remove obsolete version field from docker-compose.yml
- Create comprehensive README_DOCKER.md documentation

The Docker setup now fully supports the refactored Flask application
with modular structure, authentication, and like system.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 23:40:12 -04:00

41 lines
939 B
Docker

# Use Python 3.13 slim image as base
FROM python:3.13-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install uv for Python package management
RUN pip install uv
# Copy project files
COPY pyproject.toml .
COPY main.py .
COPY app/ app/
COPY migrate_session_changes.py .
COPY README_MIGRATION.md .
COPY README.md .
# Create uploads directory in the correct location
RUN mkdir -p app/static/uploads
# Create and activate virtual environment, then install dependencies
RUN uv venv && \
. .venv/bin/activate && \
uv pip install -e .
# Set environment variables
ENV FLASK_APP=main.py
ENV FLASK_ENV=production
ENV PATH="/app/.venv/bin:$PATH"
ENV GUNICORN_CMD_ARGS="--workers=4 --bind=0.0.0.0:5000 --timeout=120"
# Expose port
EXPOSE 5000
# Run the application with Gunicorn
CMD ["gunicorn", "main:app"]