Dockerfile 917 B

1234567891011121314151617181920212223242526
  1. # For more information, please refer to https://aka.ms/vscode-docker-python
  2. FROM python:3.10-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. RUN python -m pip install pyinstaller
  12. WORKDIR /app
  13. COPY . /app
  14. # Creates a non-root user with an explicit UID and adds permission to access the /app folder
  15. # For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
  16. RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
  17. USER appuser
  18. VOLUME [ "/app" ]
  19. # During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
  20. CMD ["pyinstaller", "-F", "-c", "main.py"]