Files
petpicturequeue/Dockerfile
2025-06-13 16:58:30 -04:00

39 lines
862 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 templates/ templates/
COPY README.md .
# Create uploads directory
RUN mkdir -p 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"]