Няма описание

Dockerfile 766B

12345678910111213141516171819202122232425262728293031323334
  1. FROM python:3.11-slim
  2. # --- Build arguments for user mapping ---
  3. ARG USERNAME=appuser
  4. ARG UID=1000
  5. ARG GID=1000
  6. # --- Install system dependencies ---
  7. RUN apt-get update && \
  8. apt-get install -y --no-install-recommends \
  9. build-essential \
  10. libpq-dev \
  11. curl \
  12. && rm -rf /var/lib/apt/lists/*
  13. # --- Create user and group matching host ---
  14. RUN groupadd -g $GID $USERNAME && \
  15. useradd -m -u $UID -g $GID $USERNAME
  16. WORKDIR /app
  17. # --- Install Python dependencies ---
  18. COPY requirements.txt .
  19. RUN pip install --no-cache-dir -r requirements.txt
  20. # --- Copy project code ---
  21. COPY . .
  22. # --- Use non-root user ---
  23. USER $USERNAME
  24. # --- Entrypoint is set via docker-compose.yml ---
  25. # For dev: migrations and runserver will be run by the Compose command