Dockerfile 542 B

123456789101112131415161718192021
  1. FROM python:3.9.16-slim
  2. # Turns off buffering for easier container logging
  3. ENV PYTHONUNBUFFERED=1
  4. COPY requirements.txt .
  5. RUN python -m pip install -r requirements.txt
  6. WORKDIR /app
  7. COPY . .
  8. RUN mkdir -p ./logs
  9. RUN python manage.py migrate
  10. # Creates a non-root user with an explicit UID and adds permission to access the /app folder
  11. # For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
  12. RUN adduser --disabled-password --gecos "" appuser && chown -R appuser /app
  13. USER appuser
  14. CMD ["python", "app.py"]