Byparr/Dockerfile

36 lines
1.0 KiB
Docker
Raw Normal View History

2024-09-13 18:03:09 +00:00
FROM python:3.12
2024-07-24 15:52:30 +00:00
2024-07-24 23:00:51 +00:00
WORKDIR /app
EXPOSE 8191
2024-07-24 15:52:30 +00:00
# python
2024-07-25 00:04:00 +00:00
ENV \
DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
2024-07-24 15:52:30 +00:00
# prevents python creating .pyc files
PYTHONDONTWRITEBYTECODE=1 \
# do not ask any interactive question
2024-07-24 23:00:51 +00:00
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=true
2024-07-24 15:52:30 +00:00
2024-07-24 23:09:03 +00:00
RUN apt update && apt upgrade -y
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt install -y --no-install-recommends --no-install-suggests ./google-chrome-stable_current_amd64.deb && rm ./google-chrome-stable_current_amd64.deb
2024-07-24 17:51:01 +00:00
2024-07-24 23:09:03 +00:00
RUN apt install pipx -y
RUN pipx ensurepath
RUN pipx install poetry
ENV PATH="/root/.local/bin:$PATH"
COPY pyproject.toml poetry.lock ./
RUN poetry install
2024-07-24 15:52:30 +00:00
2024-07-25 00:04:00 +00:00
ENV INSTALL_NOVNC=false
COPY novnc.sh .
RUN ./novnc.sh
ENV DISPLAY=:1.0
2024-09-13 18:28:36 +00:00
COPY fix_nodriver.py ./
2024-07-24 23:09:03 +00:00
RUN . /app/.venv/bin/activate && python fix_nodriver.py
2024-09-13 18:28:36 +00:00
COPY . .
RUN /usr/local/share/desktop-init.sh && poetry run pytest
2024-07-24 23:09:03 +00:00
CMD /usr/local/share/desktop-init.sh && . /app/.venv/bin/activate && python main.py