diff --git a/docker/jukebox.Dockerfile b/docker/jukebox.Dockerfile index 3249edcb8..e7a7a45b1 100644 --- a/docker/jukebox.Dockerfile +++ b/docker/jukebox.Dockerfile @@ -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 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