@@ -38,7 +38,8 @@ ENV DEBIAN_FRONTEND=noninteractive \
3838 SEL_DOWNLOAD_DIR=${HOME}/Downloads \
3939 VIDEO_FOLDER="/videos" \
4040 # Path to the Configfile
41- CONFIG_FILE="/opt/selenium/config.toml"
41+ CONFIG_FILE="/opt/selenium/config.toml" \
42+ VENV_PATH=/opt/venv
4243
4344# ========================
4445# Miscellaneous packages
@@ -69,25 +70,15 @@ RUN apt-get -qqy update \
6970# ========================================
7071# Install Python for utilities
7172# ========================================
73+ ENV PATH="$VENV_PATH/bin:$PATH" \
74+ VIRTUAL_ENV="$VENV_PATH"
75+
7276RUN apt-get -qqy update \
7377 && apt-get upgrade -yq \
7478 && apt-get -qqy --no-install-recommends install \
75- python3 python3-pip python3-venv python3-setuptools \
76- && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
77-
78- ENV VENV_PATH=/opt/venv
79- RUN python3 -m venv $VENV_PATH \
80- echo "source $VENV_PATH/bin/activate" >> /etc/bash.bashrc
81-
82- RUN $VENV_PATH/bin/python3 -m pip install --upgrade pip setuptools virtualenv psutil \
83- && wget -q https://github.com/Supervisor/supervisor/archive/refs/heads/main.zip -O /tmp/supervisor.zip \
84- && unzip /tmp/supervisor.zip -d /tmp \
85- && cd /tmp/supervisor-main \
86- && $VENV_PATH/bin/python3 -m pip install --break-system-packages . \
87- && rm -rf /tmp/supervisor.zip /tmp/supervisor-main
88-
89- ENV PATH="$VENV_PATH/bin:$PATH" \
90- VIRTUAL_ENV="$VENV_PATH"
79+ python3 python3-pip python3-venv \
80+ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
81+ && echo "source $VENV_PATH/bin/activate" >> /etc/bash.bashrc
9182
9283RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "arm64" ]; then echo "aarch64" ; else echo "$(dpkg --print-architecture)" ; fi) \
9384 && wget -q https://github.com/moparisthebest/static-curl/releases/download/v8.11.0/curl-$ARCH -O /usr/bin/curl \
@@ -198,6 +189,14 @@ RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "amd64" ]; then echo "x86_64";
198189# ===================================================
199190USER ${SEL_UID}:${SEL_GID}
200191
192+ RUN python3 -m venv $VENV_PATH \
193+ && $VENV_PATH/bin/python3 -m pip install --upgrade pip setuptools virtualenv psutil \
194+ && wget -q https://github.com/Supervisor/supervisor/archive/refs/heads/main.zip -O /tmp/supervisor.zip \
195+ && unzip /tmp/supervisor.zip -d /tmp \
196+ && cd /tmp/supervisor-main \
197+ && $VENV_PATH/bin/python3 -m pip install --break-system-packages . \
198+ && rm -rf /tmp/supervisor.zip /tmp/supervisor-main
199+
201200RUN /opt/bin/add-jks-helper.sh -d /opt/selenium/secrets \
202201 && /opt/bin/add-cert-helper.sh -d /opt/selenium/secrets ${CERT_TRUST_ATTR}
203202# ======================================
0 commit comments