From 5d37b37d7b239ec7b11a6ec5c2a8081baf96167e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Busse?= Date: Sun, 24 Nov 2024 15:56:52 +0100 Subject: [PATCH] Use a venv with Python --- Containerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Containerfile b/Containerfile index 4784f52..a1c560c 100644 --- a/Containerfile +++ b/Containerfile @@ -4,9 +4,10 @@ LABEL maintainer="Björn Busse " LABEL org.opencontainers.image.source https://github.com/bbusse/swayvnc-firefox ENV ARCH="x86_64" \ - USER="firefox-user" \ + USER="swayvnc" \ APK_ADD="libc-dev libffi-dev libxkbcommon-dev gcc geckodriver@testing git python3 python3-dev py3-pip py3-wheel firefox" \ APK_DEL="" + PATH_VENV="/home/swayvnc/venv/" USER root @@ -42,8 +43,12 @@ RUN addgroup -S $USER && adduser -S $USER -G $USER \ USER $USER -RUN pip3 install --user -r /tmp/requirements_controller.txt -RUN pip3 install --user -r /tmp/requirements_webdriver.txt +RUN mkdir -p ${PATH_VENV} && \ + python3 -m venv /home/swayvnc/venv && \ + . ${PATH_VENV}/bin/activate && \ + pip3 install --user -r /tmp/requirements_controller.txt && \ + pip3 install --user -r /tmp/requirements_webdriver.txt && \ + deactivate COPY entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"]