davanstrien HF Staff commited on
Commit
93b9db8
·
verified ·
1 Parent(s): 920c564

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -1,24 +1,24 @@
1
  FROM python:3.12-slim
2
 
 
 
 
 
 
 
 
 
3
  # Create non-root user (HF Spaces runs as user ID 1000)
4
  RUN useradd -m -u 1000 user
5
  USER user
6
 
7
  # Set home and path
8
  ENV HOME=/home/user \
9
- PATH=/home/user/.local/bin:$PATH \
10
- HF_HUB_ENABLE_HF_TRANSFER=1
11
 
12
  WORKDIR $HOME/app
13
 
14
- # Install uv for fast dependency management
15
- RUN pip install --no-cache-dir --upgrade pip uv
16
-
17
- # Copy and install dependencies
18
- COPY --chown=user requirements.txt .
19
- RUN uv pip install --no-cache -r requirements.txt
20
-
21
- # Copy application
22
  COPY --chown=user . .
23
 
24
  # Create data directory for dataset download
 
1
  FROM python:3.12-slim
2
 
3
+ # Enable HF transfer for faster downloads
4
+ ENV HF_HUB_ENABLE_HF_TRANSFER=1
5
+
6
+ # Install uv and dependencies as root (to system site-packages)
7
+ RUN pip install --no-cache-dir uv
8
+ COPY requirements.txt /tmp/requirements.txt
9
+ RUN uv pip install --system --no-cache -r /tmp/requirements.txt
10
+
11
  # Create non-root user (HF Spaces runs as user ID 1000)
12
  RUN useradd -m -u 1000 user
13
  USER user
14
 
15
  # Set home and path
16
  ENV HOME=/home/user \
17
+ PATH=/home/user/.local/bin:$PATH
 
18
 
19
  WORKDIR $HOME/app
20
 
21
+ # Copy application (as user)
 
 
 
 
 
 
 
22
  COPY --chown=user . .
23
 
24
  # Create data directory for dataset download