Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# create app dir
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
ENV PYTHONUNBUFFERED=1
|
| 7 |
+
|
| 8 |
+
# copy project files
|
| 9 |
+
COPY . /app
|
| 10 |
+
|
| 11 |
+
# install deps
|
| 12 |
+
RUN pip install --upgrade pip
|
| 13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
+
|
| 15 |
+
# create templates directory permissions
|
| 16 |
+
RUN mkdir -p /tmp && chmod -R 777 /tmp
|
| 17 |
+
|
| 18 |
+
# expose HF spaces port
|
| 19 |
+
EXPOSE 7860
|
| 20 |
+
|
| 21 |
+
# default command: run uvicorn
|
| 22 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|