offiongbassey commited on
Commit
a83fdf5
·
verified ·
1 Parent(s): 70d182a

Dockerfile created

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ── Base image ──────────────────────────────────────────────────────────────
2
+ # HF Spaces expects port 7860 and runs as a non-root user by default.
3
+ # python:3.10-slim keeps the image lean; ffmpeg handles any resample needs.
4
+ FROM python:3.10-slim
5
+
6
+ # ── System deps ─────────────────────────────────────────────────────────────
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
8
+ ffmpeg \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # ── Working directory ────────────────────────────────────────────────────────
12
+ WORKDIR /app
13
+
14
+ # ── Python deps ──────────────────────────────────────────────────────────────
15
+ COPY requirements.txt .
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # ── App code ─────────────────────────────────────────────────────────────────
19
+ COPY app.py .
20
+
21
+ # ── HF Spaces: non-root user required ────────────────────────────────────────
22
+ RUN useradd -m appuser
23
+ USER appuser
24
+
25
+ # ── Expose HF Spaces default port ────────────────────────────────────────────
26
+ EXPOSE 7860
27
+
28
+ # ── Start ─────────────────────────────────────────────────────────────────────
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]