From a871107728efef50e4f8a4f1bea6ec0525536f27 Mon Sep 17 00:00:00 2001 From: Olamide Isreal Date: Wed, 25 Mar 2026 12:57:45 +0100 Subject: [PATCH] Fix Dockerfile permissions for K8s execution Make .gradle, output, build, and modules directories writable (chmod 777) so the container works when K8s runs it as a non-root user. --- Dockerfile | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index b7c61a4..fa7b937 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,21 +50,12 @@ RUN mkdir -p /app/modules # Test a simple module generation to ensure Synthea works RUN ./run_synthea -p 1 -m hypertension -# Set up a symlink from mounted modules to Synthea modules directory -RUN echo '#!/bin/sh\n\ -# Update modules symlinks\n\ -# Load environment variables\n\ -if [ -f /app/.env ]; then\n\ - export $(grep -v "^#" /app/.env | xargs)\n\ -fi\n\ -\n\ -exec "$@"' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh +# Make directories writable for K8s (may run as non-root) +RUN chmod -R 777 /app/.gradle /app/output /app/build /app/modules \ + /app/src/main/resources/modules # Set PYTHONPATH to ensure modules can be found ENV PYTHONPATH="/app" -# Set entrypoint to use our script -ENTRYPOINT ["/app/entrypoint.sh"] - # Default command when container runs CMD ["tail", "-f", "/dev/null"] \ No newline at end of file