Dockerfile 829 B

1234567891011121314151617181920212223
  1. # For more information, please refer to https://aka.ms/vscode-docker-python
  2. FROM python:3-slim
  3. # Keeps Python from generating .pyc files in the container
  4. ENV PYTHONDONTWRITEBYTECODE=1
  5. # Turns off buffering for easier container logging
  6. ENV PYTHONUNBUFFERED=1
  7. # Install pip requirements
  8. COPY requirements.txt .
  9. RUN python -m pip install -r requirements.txt
  10. WORKDIR /app
  11. COPY . /app
  12. # Creates a non-root user with an explicit UID and adds permission to access the /app folder
  13. # For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
  14. RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
  15. USER appuser
  16. # During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
  17. CMD ["python", "main.py"]