procrustes / Dockerfile
QCDevs's picture
Add draft
19d59ff verified
raw
history blame contribute delete
696 Bytes
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create uploads directory
RUN mkdir -p uploads && chmod 777 uploads
# Create a non-root user
RUN useradd -m appuser && chown -R appuser:appuser /app
USER appuser
# # Set environment variables for the buffered output
# ENV PYTHONUNBUFFERED=1
# Default command (can be overridden in docker-compose.yml)
CMD ["gunicorn", "--config", "gunicorn_config.py", "app:app"]