Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. FROM --platform=linux/amd64 python:3.8
  2. ENV POETRY_VERSION=1.6.1 \
  3. POETRY_NO_INTERACTION=1 \
  4. POETRY_VIRTUALENVS_IN_PROJECT=false \
  5. POETRY_VIRTUALENVS_CREATE=false \
  6. DEBIAN_FRONTEND=noninteractive \
  7. DISPLAY=:99
  8. # Install packages
  9. RUN apt-get update && apt-get install --no-install-recommends -y \
  10. sudo git build-essential chromium chromium-driver \
  11. && rm -rf /var/lib/apt/lists/*
  12. # Create remote user
  13. ARG USERNAME=vscode
  14. ARG USER_UID=1000
  15. ARG USER_GID=$USER_UID
  16. RUN groupadd --gid $USER_GID $USERNAME \
  17. && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
  18. && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
  19. && chmod 0440 /etc/sudoers.d/$USERNAME
  20. ENV PATH="/home/${USERNAME}/.local/bin:${PATH}"
  21. ENV CHROME_BINARY_LOCATION=/usr/bin/chromium
  22. # Install nicegui
  23. RUN pip install -U pip && pip install poetry==$POETRY_VERSION
  24. COPY pyproject.toml poetry.lock README.md ./
  25. RUN poetry install --all-extras --no-root
  26. RUN pip install latex2mathml
  27. USER $USERNAME
  28. ENTRYPOINT ["poetry", "run", "python", "-m", "debugpy", "--listen" ,"5678", "main.py"]