From 29b26565ea93d18e77debba5607517a9fc5ad106 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Wed, 4 Dec 2024 16:55:01 +0100 Subject: [PATCH] feat: properly fix permissions on image --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ba1f7762..8cd35afd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* # Create a non-root user and switch to it -RUN adduser --system --no-create-home codegate --uid 1000 +RUN useradd -rm -d /home/codegate -s /bin/bash -g root -G sudo -u 1001 codegate USER codegate WORKDIR /app @@ -38,6 +38,11 @@ WORKDIR /app COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages COPY --from=builder /app /app +# change permissions +USER root +RUN chown -R codegate /app +USER codegate + # Set the PYTHONPATH environment variable ENV PYTHONPATH=/app/src