Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +35 -0
Dockerfile
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.12-slim
|
| 2 |
+
|
| 3 |
+
ENV PYTHONUNBUFFERED=1
|
| 4 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 5 |
+
|
| 6 |
+
WORKDIR /app
|
| 7 |
+
|
| 8 |
+
RUN apt-get update && \
|
| 9 |
+
apt-get install -y \
|
| 10 |
+
git \
|
| 11 |
+
build-essential \
|
| 12 |
+
libgomp1 \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
COPY requirements.txt .
|
| 16 |
+
|
| 17 |
+
RUN pip install --no-cache-dir \
|
| 18 |
+
--index-url https://download.pytorch.org/whl/cpu \
|
| 19 |
+
torch
|
| 20 |
+
|
| 21 |
+
RUN pip install --no-cache-dir \
|
| 22 |
+
fastapi \
|
| 23 |
+
"uvicorn[standard]" \
|
| 24 |
+
transformers \
|
| 25 |
+
safetensors \
|
| 26 |
+
sentencepiece
|
| 27 |
+
|
| 28 |
+
COPY app.py .
|
| 29 |
+
|
| 30 |
+
# Your merged model can either be copied into the image
|
| 31 |
+
# or downloaded from a Hugging Face model repository.
|
| 32 |
+
|
| 33 |
+
EXPOSE 7860
|
| 34 |
+
|
| 35 |
+
CMD ["python", "app.py"]
|