diff --git a/Dockerfile b/Dockerfile index eefa0c1..1c155e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,6 +51,17 @@ COPY pyproject.toml ./ # Create healthcheck file RUN touch /app/healthcheck +# Create non-root user with UID 1000 for improved security +# This ensures the application can write to /app/healthcheck at runtime +RUN groupadd -f -g 1000 oracle && \ + useradd -u 1000 -g oracle -s /bin/bash -m oracle + +# Change ownership of all /app files to the oracle user +RUN chown -R oracle:oracle /app + +# Switch to non-root user for runtime security +USER oracle + # Use Tini as entrypoint for proper signal handling ENTRYPOINT ["/usr/bin/tini", "--"]