LisaMegaWatts commited on
Commit
18c68e7
·
verified ·
1 Parent(s): 0a315c6

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 juliaslm_svd_model.py .
15
+ COPY --chown=user server.py .
16
+
17
+ # Create checkpoints directory (model downloads from HF at runtime)
18
+ RUN mkdir -p /home/user/app/checkpoints && chown user:user /home/user/app/checkpoints
19
+
20
+ # Switch to non-root user
21
+ USER user
22
+ ENV HOME=/home/user
23
+
24
+ EXPOSE 7860
25
+
26
+ CMD ["python", "server.py"]