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:
15
Dockerfile
15
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"]
|
||||
Reference in New Issue
Block a user