ncolex commited on
Commit
4c653b1
·
verified ·
1 Parent(s): c5f9050

Fix health check - use python urllib instead of curl

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -3
Dockerfile CHANGED
@@ -70,11 +70,15 @@ EXPOSE 8000
70
 
71
  # Create a non-root user for security (the playwright image already has pwuser)
72
  RUN chown -R pwuser:pwuser /app
 
 
 
 
73
  USER pwuser
74
 
75
- # Health check
76
- HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
77
- CMD curl -f http://localhost:8000/ || exit 1
78
 
79
  # Run the application using entrypoint
80
  ENTRYPOINT ["/entrypoint.sh"]
 
70
 
71
  # Create a non-root user for security (the playwright image already has pwuser)
72
  RUN chown -R pwuser:pwuser /app
73
+
74
+ # Install curl for health check before switching to non-root user
75
+ RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
76
+
77
  USER pwuser
78
 
79
+ # Health check - use wget instead of curl (more reliable in containers)
80
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
81
+ CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/')" || exit 1
82
 
83
  # Run the application using entrypoint
84
  ENTRYPOINT ["/entrypoint.sh"]