|
# Use the latest Python 3.13 slim image for a lightweight base
|
|
FROM python:3.13-slim
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
# Set work directory
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies if needed (for Dulwich, etc.)
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy requirements file
|
|
COPY requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy project
|
|
COPY . .
|
|
|
|
# Expose port
|
|
EXPOSE 9001
|
|
|
|
# Run the application
|
|
CMD ["python", "-m", "retoors.main", "--host", "0.0.0.0", "--port", "9001"]
|