Update Dockerfile.production to use /app as WORKDIR
Change-Id: I542ae1f1223fb77e6154682a29cf7c5b27dd8eab
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/Dockerfile.production b/Dockerfile.production
index 03acd6d..748ec71 100644
--- a/Dockerfile.production
+++ b/Dockerfile.production
@@ -43,17 +43,16 @@
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 @@
# 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 @@
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