Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +17 -0
Dockerfile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
|
| 4 |
+
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
COPY requirements.txt .
|
| 7 |
+
RUN pip install -U pip && pip install -r requirements.txt
|
| 8 |
+
|
| 9 |
+
COPY main.py .
|
| 10 |
+
|
| 11 |
+
ENV PORT=8080
|
| 12 |
+
EXPOSE 8080
|
| 13 |
+
|
| 14 |
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
| 15 |
+
CMD curl -fsS "http://localhost:${PORT}/health" || exit 1
|
| 16 |
+
|
| 17 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
|