rkihacker commited on
Commit
c24167d
·
verified ·
1 Parent(s): baf9fa9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -6
Dockerfile CHANGED
@@ -1,12 +1,19 @@
1
- FROM python:3.9-slim
 
 
 
2
 
3
  WORKDIR /app
4
 
5
- # Copy ALL files (because Docker is stupid)
6
- COPY . .
 
7
 
8
- # Install dependencies
9
- RUN pip install fastapi uvicorn
10
 
11
- # Run the API
 
 
 
 
12
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # -------------------------------------------------
2
+ # Use the official HF Python image (includes sudo)
3
+ # -------------------------------------------------
4
+ FROM python:3.12-slim
5
 
6
  WORKDIR /app
7
 
8
+ # Install only what we need
9
+ COPY requirements.txt .
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
 
12
+ COPY main.py .
 
13
 
14
+ EXPOSE 8000
15
+
16
+ # Raw sockets need CAP_NET_RAW + CAP_NET_ADMIN
17
+ # Hugging Face Spaces runs containers with --cap-add automatically,
18
+ # but for local testing add them manually.
19
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]