From faaa81995c19b1d014a5432c22f0d8d851fc674c Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Mon, 18 Mar 2024 02:06:07 +0000 Subject: [PATCH] fix building image --- docker/Dockerfile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 86cb8e1d2..986a23abf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,7 @@ RUN npm install RUN npm run build # Setup frontend -FROM nginx:1.24-alpine3.17-slim as production-stage +FROM nginx:1.25.4-alpine3.18-slim as production-stage ARG WEBSERVER_FOLDER=/var/www/html COPY --from=front-build-stage /front/dist ${WEBSERVER_FOLDER} COPY ./frontend/assets/default ${WEBSERVER_FOLDER}/assets/default @@ -56,7 +56,9 @@ RUN . /backend/bin/activate && \ # Install project dependencies using poetry RUN . /backend/bin/activate && \ + mkdir -p /root/.cache/pypoetry/virtualenvs && \ python3 -m poetry config --no-cache virtualenvs.create false && \ + python3 -m poetry env use 3.11 && \ python3 -m poetry install --no-interaction --no-ansi --no-cache --only main && \ python3 -m poetry export --without-hashes --only main --without-urls | awk -F= '{print $1}' > /installed_poetry_requirements.txt @@ -148,21 +150,16 @@ RUN rm -r \ /docker-entrypoint.sh \ /docker-entrypoint.d -# Set environment variables for the init script -ENV PUID=1000 \ - PGID=1000 \ - UMASK=022 - # Move everything we prepared over to our final docker image FROM scratch COPY --from=production-stage / / # User permissions -RUN addgroup -u "$PGID" -S romm && adduser -u "$PUID" -D -S -G romm romm -RUN mkdir /romm && chown "$PUID":"$PGID" /romm +RUN addgroup -g 1000 -S romm && adduser -u 1000 -D -S -G romm romm +RUN mkdir /romm && chown romm:romm /romm # Create data volume for redis and set permissions -RUN mkdir /redis-data && chown "$PUID":"$PGID" /redis-data +RUN mkdir /redis-data && chown romm:romm /redis-data VOLUME /redis-data # Expose ports and start