wuhp commited on
Commit
5e9083a
·
verified ·
1 Parent(s): 9c58543

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # HF Docker Spaces run as a non-root user by convention; keep it simple and just
4
+ # make sure the workdir is writable.
5
+ WORKDIR /app
6
+
7
+ # --- system deps (torch wheel needs none extra on slim, but keep build tools just in case) ---
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
+ build-essential \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # --- python deps first, for layer caching ---
13
+ COPY requirements.txt .
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # --- copy the repo's source files (already using valid underscore module names) ---
17
+ COPY corvidae.py .
18
+ COPY corvid_extensions.py .
19
+ COPY corvid_aviary.py .
20
+ COPY species_memory_bank.py .
21
+ COPY corvid_eval.py .
22
+ COPY app.py .
23
+
24
+ # HF Docker Spaces expect the app to listen on port 7860
25
+ ENV PORT=7860
26
+ EXPOSE 7860
27
+
28
+ # Run as a non-root user (HF Spaces best practice)
29
+ RUN useradd -m -u 1000 appuser
30
+ USER appuser
31
+
32
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]