xdragxt commited on
Commit
96bd19d
·
verified ·
1 Parent(s): b1c1f58

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ git \
6
+ bash \
7
+ dnsutils \
8
+ curl \
9
+ ffmpeg \
10
+ sudo \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Working directory
14
+ WORKDIR /app
15
+
16
+ # Copy launcher
17
+ COPY app.py .
18
+
19
+ # Install Python dependencies
20
+ RUN pip install --no-cache-dir fastapi uvicorn httpx
21
+
22
+ # HuggingFace Spaces port
23
+ EXPOSE 7860
24
+
25
+ # Startup: try to change DNS then start server
26
+ CMD sh -c 'echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf >/dev/null 2>&1; \
27
+ echo "nameserver 1.0.0.1" | sudo tee -a /etc/resolv.conf >/dev/null 2>&1; \
28
+ uvicorn app:app --host 0.0.0.0 --port 7860'