diff --git a/Dockerfile b/Dockerfile index d420d04302a4831cc2c22af2e59f30ff369102ed..35dacdf7c5af1f77f6532a5f49a0fb56619493c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,12 +69,16 @@ VOLUME [ "${MODEL_PATH}", "${OUTPUT_PATH}" ] WORKDIR /app -COPY --from=builder /app/build/libs/nshmp-haz.jar . -COPY scripts scripts - USER root -RUN yum install -y jq \ - && echo "{}" > "${CONFIG_FILE}" +RUN yum install -y jq && \ + chown -R usgs-user:usgs-user /app + +USER usgs-user + +COPY --from=builder --chown=usgs-user:usgs-user /app/build/libs/nshmp-haz.jar . +COPY --chown=usgs-user:usgs-user scripts scripts + +RUN echo "{}" > "${CONFIG_FILE}" ENTRYPOINT [ "bash", "scripts/docker-entrypoint.sh" ] diff --git a/ws.Dockerfile b/ws.Dockerfile index cbf70cad8f22b9d750852562baca3988b3af75be..3f729424b7352b1fe0a6824b1f6d071d2ff4ceb9 100644 --- a/ws.Dockerfile +++ b/ws.Dockerfile @@ -52,8 +52,14 @@ ENV MODELS_DIRECTORY="/app/model" WORKDIR /app -COPY --from=builder /app/build/libs/nshmp-haz.jar . -COPY --from=builder /app/nshms.yml . +USER root + +RUN chown -R usgs-user:usgs-user /app + +USER usgs-user + +COPY --from=builder --chown=usgs-user:usgs-user /app/build/libs/nshmp-haz.jar . +COPY --from=builder --chown=usgs-user:usgs-user /app/nshms.yml . VOLUME [ "${MODELS_DIRECTORY}" ]