Skip to content

Commit

Permalink
Reorder 'USER' command
Browse files Browse the repository at this point in the history
This makes sure the 'venv' is initalized using the correct user, preventing permission errors

Closes issue #2198
  • Loading branch information
pre-commit fix Vito Zanotelli committed Jan 2, 2024
1 parent 3a904b5 commit 720a7c6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docker/jukebox.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ RUN apt-get update && apt-get install -qq -y \
espeak mpc mpg123 git ffmpeg spi-tools netcat \
python3 python3-venv python3-dev python3-mutagen

# Copy in the source code using the correct permissions
COPY --chown=${USER}:${USER} . ${INSTALLATION_PATH}/

# Switch to the `$USER` (typically `pi`)
USER ${USER}
WORKDIR ${HOME}

# Initialize venv using
ENV VIRTUAL_ENV=${INSTALLATION_PATH}/.venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

USER ${USER}
WORKDIR ${HOME}
COPY --chown=${USER}:${USER} . ${INSTALLATION_PATH}/

RUN pip install --no-cache-dir -r ${INSTALLATION_PATH}/requirements.txt

Expand Down

0 comments on commit 720a7c6

Please sign in to comment.