Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +6 -2
Dockerfile
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
# Usa l'immagine base ufficiale di Python
|
2 |
FROM python:3.8-slim
|
3 |
|
4 |
-
# Installare le dipendenze di sistema necessarie per OpenCV
|
5 |
RUN apt-get update && apt-get install -y \
|
6 |
libgl1-mesa-glx \
|
7 |
-
libglib2.0-0
|
|
|
8 |
|
9 |
# Creare un utente non root
|
10 |
RUN useradd -m -u 1000 user
|
@@ -27,3 +28,6 @@ USER user
|
|
27 |
# Comando per eseguire lo script di inferenza con Gunicorn
|
28 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "app:app"]
|
29 |
|
|
|
|
|
|
|
|
1 |
# Usa l'immagine base ufficiale di Python
|
2 |
FROM python:3.8-slim
|
3 |
|
4 |
+
# Installare le dipendenze di sistema necessarie per OpenCV e altri requisiti
|
5 |
RUN apt-get update && apt-get install -y \
|
6 |
libgl1-mesa-glx \
|
7 |
+
libglib2.0-0 \
|
8 |
+
curl
|
9 |
|
10 |
# Creare un utente non root
|
11 |
RUN useradd -m -u 1000 user
|
|
|
28 |
# Comando per eseguire lo script di inferenza con Gunicorn
|
29 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "app:app"]
|
30 |
|
31 |
+
# Aggiungi un health check (opzionale)
|
32 |
+
HEALTHCHECK --interval=1m --timeout=10s CMD curl -f http://localhost:8080/health || exit 1
|
33 |
+
|