Dockerfile 874 B

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