Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +24 -0
Dockerfile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.10 base
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# set workdir
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# system deps (minimal)
|
| 8 |
+
RUN apt-get update && apt-get install -y build-essential gcc --no-install-recommends \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# copy files
|
| 12 |
+
COPY requirements.txt ./requirements.txt
|
| 13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
+
|
| 15 |
+
COPY . /app
|
| 16 |
+
|
| 17 |
+
# If you want to train inside container uncomment next line:
|
| 18 |
+
# RUN python train_model.py
|
| 19 |
+
|
| 20 |
+
# Expose HF expected port 7860
|
| 21 |
+
EXPOSE 7860
|
| 22 |
+
|
| 23 |
+
# Run uvicorn on port 7860 (HF expects server on this port)
|
| 24 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|