LisaMegaWatts commited on
Commit
9113a98
·
verified ·
1 Parent(s): c79eabb

fix: add user 1000 (HF Spaces requirement)

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -4
Dockerfile CHANGED
@@ -1,14 +1,23 @@
1
  FROM python:3.11-slim
2
 
3
- WORKDIR /app
 
4
 
5
- # Install dependencies
6
- COPY requirements.txt .
 
 
7
  RUN pip install --no-cache-dir -r requirements.txt \
8
  --extra-index-url https://download.pytorch.org/whl/cpu
9
 
10
  # Copy application code
11
- COPY . .
 
 
 
 
 
 
12
 
13
  EXPOSE 7860
14
 
 
1
  FROM python:3.11-slim
2
 
3
+ # HuggingFace Spaces requires user ID 1000
4
+ RUN useradd -m -u 1000 user
5
 
6
+ WORKDIR /home/user/app
7
+
8
+ # Install dependencies (CPU-only torch to keep image small)
9
+ COPY --chown=user requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt \
11
  --extra-index-url https://download.pytorch.org/whl/cpu
12
 
13
  # Copy application code
14
+ COPY --chown=user symbio_model.py .
15
+ COPY --chown=user tokenizer.py .
16
+ COPY --chown=user server.py .
17
+
18
+ # Switch to non-root user
19
+ USER user
20
+ ENV HOME=/home/user
21
 
22
  EXPOSE 7860
23