From ec160e45aa4454a9983deefb25d542bbefe39497 Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Fri, 3 Nov 2023 15:07:31 +0100 Subject: [PATCH] small Dockerfile updates --- Dockerfile | 2 +- entrypoint.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 36e5af27..73504a46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,6 @@ ARG ARTIFACT_VERSION RUN apk add --no-cache gcc libc-dev libffi-dev && \ addgroup -S appgroup && adduser -S appuser -G appgroup -h /app -USER appuser RUN pip install \ --pre \ @@ -27,5 +26,6 @@ ENV TRANSLATIONS_DIR=/app/gso/translations/ COPY --chown=appuser:appgroup --chmod=755 entrypoint.sh /app/entrypoint.sh +USER appuser EXPOSE 8080 ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 471f51da..177fc999 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,8 @@ #!/bin/sh +set -o errexit +set -o nounset -# Run database migrations -cd gso || exit 1 +cd /app/gso mv migrations migrations_temp && \ PYTHONPATH=.. python main.py db init && \ rm -rf migrations && \ -- GitLab