diff --git a/Dockerfile b/Dockerfile
index 36e5af274cc310344c5bf595838366b46652405b..73504a46644a1c9a4c9e1ea8a1427f4bdf8a9c39 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 471f51da4f6478e215b7e869a7e160bd31d7d003..177fc999897e830d0fd23493abe8f62ce5cf248e 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 && \