Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +15 -4
Dockerfile
CHANGED
|
@@ -1,6 +1,17 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
COPY requirements.txt .
|
| 4 |
-
RUN pip install -r requirements.txt
|
|
|
|
| 5 |
COPY app.py .
|
| 6 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
ENV HF_HOME=/data/hfcache \
|
| 4 |
+
TRANSFORMERS_CACHE=/data/hfcache \
|
| 5 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 6 |
+
PYTHONUNBUFFERED=1
|
| 7 |
+
|
| 8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
WORKDIR /app
|
| 11 |
COPY requirements.txt .
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
+
|
| 14 |
COPY app.py .
|
| 15 |
+
|
| 16 |
+
EXPOSE 7860
|
| 17 |
+
CMD bash -lc "uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860}"
|