Spaces:
Runtime error
Runtime error
fix: add HEALTHCHECK to Dockerfile - prevents silent dead container after 24h
Browse files- Dockerfile +6 -1
Dockerfile
CHANGED
|
@@ -37,7 +37,12 @@ COPY --from=frontend-builder /app/public ./public
|
|
| 37 |
# HuggingFace Spaces uses port 7860
|
| 38 |
EXPOSE 7860
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Copy and run entrypoint
|
| 41 |
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
| 42 |
RUN chmod +x /docker-entrypoint.sh
|
| 43 |
-
CMD ["/docker-entrypoint.sh"]
|
|
|
|
| 37 |
# HuggingFace Spaces uses port 7860
|
| 38 |
EXPOSE 7860
|
| 39 |
|
| 40 |
+
# Health check - confirms both frontend and backend are alive
|
| 41 |
+
# start-period gives time for model warmup before HF marks it unhealthy
|
| 42 |
+
HEALTHCHECK --interval=30s --timeout=15s --start-period=120s --retries=5 \
|
| 43 |
+
CMD curl --fail --silent http://localhost:7860/ || exit 1
|
| 44 |
+
|
| 45 |
# Copy and run entrypoint
|
| 46 |
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
| 47 |
RUN chmod +x /docker-entrypoint.sh
|
| 48 |
+
CMD ["/docker-entrypoint.sh"]
|