Spaces:
Runtime error
Runtime error
Update dockerfile
Browse files- dockerfile +5 -4
dockerfile
CHANGED
|
@@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 5 |
build-essential \
|
| 6 |
libffi-dev \
|
| 7 |
libssl-dev \
|
|
|
|
| 8 |
&& apt-get clean \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
@@ -20,9 +21,9 @@ COPY app.py .
|
|
| 20 |
# Expose port 8000
|
| 21 |
EXPOSE 8000
|
| 22 |
|
| 23 |
-
# Health check
|
| 24 |
-
HEALTHCHECK --interval=30s --timeout=
|
| 25 |
CMD curl -f http://localhost:8000/health || exit 1
|
| 26 |
|
| 27 |
-
# Run gunicorn with FastAPI
|
| 28 |
-
CMD ["gunicorn", "-
|
|
|
|
| 5 |
build-essential \
|
| 6 |
libffi-dev \
|
| 7 |
libssl-dev \
|
| 8 |
+
curl \
|
| 9 |
&& apt-get clean \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
|
|
|
| 21 |
# Expose port 8000
|
| 22 |
EXPOSE 8000
|
| 23 |
|
| 24 |
+
# Health check with increased timeout and start period
|
| 25 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
| 26 |
CMD curl -f http://localhost:8000/health || exit 1
|
| 27 |
|
| 28 |
+
# Run gunicorn with FastAPI, simplified command
|
| 29 |
+
CMD ["gunicorn", "-k", "uvicorn.workers.UvicornWorker", "app:app", "--bind", "0.0.0.0:8000", "--workers", "2", "--timeout", "120", "--log-level", "info"]
|