Skip to content

Commit

Permalink
Use a venv with Python
Browse files Browse the repository at this point in the history
  • Loading branch information
bbusse committed Nov 24, 2024
1 parent 0e4d019 commit 66f4671
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ LABEL maintainer="Björn Busse <[email protected]>"
LABEL org.opencontainers.image.source https://github.com/bbusse/swayvnc-firefox

Check warning on line 4 in Containerfile

View workflow job for this annotation

GitHub Actions / container-build-push / build-and-push-container

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "LABEL key=value" should be used instead of legacy "LABEL key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

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=""
APK_DEL="" \
PATH_VENV="/home/swayvnc/venv"

USER root

Expand Down Expand Up @@ -38,12 +39,17 @@ RUN addgroup -S $USER && adduser -S $USER -G $USER \
&& wget -O /tmp/requirements_controller.txt https://raw.githubusercontent.com/OpsBoost/iss-display-controller/dev/requirements.txt \

# Run controller.py
&& echo "exec controller.py --uri="iss-weather://" --stream-source=vnc-browser --debug=$DEBUG" >> /etc/sway/config.d/firefox
&& echo "exec /usr/bin/env sh -c 'source ${PATH_VENV}/bin/activate && controller.py --uri=iss-weather:// --stream-source=vnc-browser'" \
> /etc/sway/config.d/firefox

Check warning on line 43 in Containerfile

View workflow job for this annotation

GitHub Actions / container-build-push / build-and-push-container

Empty continuation lines will become errors in a future release

NoEmptyContinuation: Empty continuation line More info: https://docs.docker.com/go/dockerfile/rule/no-empty-continuation/

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 -r /tmp/requirements_controller.txt && \
pip3 install -r /tmp/requirements_webdriver.txt && \
deactivate

COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit 66f4671

Please sign in to comment.