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.
This commit is contained in:
2026-03-25 12:57:45 +01:00
parent d468509ec3
commit a871107728

View File

@@ -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"]