From b1a3f9f4c3df59a0c124f114d7fee2f80c767f4e Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Fri, 26 Dec 2025 11:28:20 +0100 Subject: [PATCH] Update Dockerfile.production to use /app as WORKDIR Change-Id: I542ae1f1223fb77e6154682a29cf7c5b27dd8eab Signed-off-by: garciadeblas --- Dockerfile.production | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Dockerfile.production b/Dockerfile.production index 03acd6db..748ec71f 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -43,17 +43,16 @@ RUN apk add --no-cache \ libxml2-dev \ libxslt-dev -WORKDIR /app/mon +WORKDIR /app # Create virtual environment -RUN python -m venv /app/mon/.venv -ENV PATH="/app/mon/.venv/bin:$PATH" +RUN python -m venv /app/.venv +ENV PATH="/app/.venv/bin:$PATH" ARG COMMON_GERRIT_REFSPEC=master # Install OSM dependency modules with no cache -RUN --mount=type=cache,target=/root/.cache/pip \ - git clone --filter=blob:none --tags https://osm.etsi.org/gerrit/osm/common.git /tmp/osm-common && \ +RUN git clone --filter=blob:none --tags https://osm.etsi.org/gerrit/osm/common.git /tmp/osm-common && \ cd /tmp/osm-common && \ git fetch origin "${COMMON_GERRIT_REFSPEC}" && \ git checkout FETCH_HEAD &&\ @@ -63,8 +62,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \ # Install MON COPY . . -RUN --mount=type=cache,target=/root/.cache/pip \ - pip install --no-cache-dir -r requirements.txt \ +RUN pip install --no-cache-dir -r requirements.txt \ && pip install --no-cache-dir . @@ -82,25 +80,24 @@ RUN apk add --no-cache \ openssh-client # Copy virtual environment from build stage -COPY --from=builder /app/mon/.venv /app/mon/.venv -ENV PATH="/app/mon/.venv/bin:$PATH" +COPY --from=builder /app/.venv /app/.venv +ENV PATH="/app/.venv/bin:$PATH" # Copy necessary binaries and libraries COPY --from=builder /usr/lib/ /usr/lib/ COPY --from=builder /lib/ /lib/ # Copy application scripts -COPY scripts/ /app/mon/scripts/ +COPY scripts/ /app/scripts/ # Create app user and directories RUN addgroup -g 1000 appuser && \ adduser -u 1000 -G appuser -D -h /app appuser && \ - mkdir -p /app/mon && \ mkdir -p /app/storage/kafka && \ mkdir /app/log && \ chown -R appuser:appuser /app -WORKDIR /app/mon +WORKDIR /app USER appuser -- 2.25.1