Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -7
Dockerfile
CHANGED
|
@@ -1,19 +1,29 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
RUN
|
|
|
|
| 5 |
|
| 6 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
-
#
|
| 10 |
COPY app.py .
|
| 11 |
|
| 12 |
-
#
|
| 13 |
RUN pip install --no-cache-dir fastapi uvicorn
|
| 14 |
|
| 15 |
-
#
|
| 16 |
EXPOSE 7860
|
| 17 |
|
| 18 |
-
#
|
| 19 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Set Cloudflare DNS
|
| 4 |
+
RUN echo "nameserver 1.1.1.1" > /etc/resolv.conf && \
|
| 5 |
+
echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
| 6 |
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
bash \
|
| 11 |
+
dnsutils \
|
| 12 |
+
curl \
|
| 13 |
+
ffmpeg \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# Working directory
|
| 17 |
WORKDIR /app
|
| 18 |
|
| 19 |
+
# Copy launcher
|
| 20 |
COPY app.py .
|
| 21 |
|
| 22 |
+
# Install Python dependencies
|
| 23 |
RUN pip install --no-cache-dir fastapi uvicorn
|
| 24 |
|
| 25 |
+
# HuggingFace Spaces port
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
+
# Start server
|
| 29 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|