CooLLaMACEO commited on
Commit
2353df0
·
verified ·
1 Parent(s): 0187888

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -13
Dockerfile CHANGED
@@ -2,31 +2,28 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install git and git-lfs to handle large files
6
  RUN apt-get update && apt-get install -y \
7
  git \
8
  git-lfs \
9
  && git lfs install \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Install requirements
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # ARG allows passing the token during build time
17
- ARG HF_TOKEN
18
- ENV HF_TOKEN=${HF_TOKEN}
19
-
20
- # Use the CLI to download only the model files into the /app/model folder
21
- # This skips the git history, README, and attributes automatically
22
- RUN huggingface-cli download CooLLaMACEO/Overflow-100B \
23
  --local-dir /app/model \
24
  --local-dir-use-symlinks False \
25
- --exclude "README.md" ".gitattributes" \
26
- --token ${HF_TOKEN}
27
 
28
- # Copy your local app files
29
- COPY app.py modeling_overflow.py configuration_overflow.py ./
30
 
31
  # Force CPU mode
32
  ENV CUDA_VISIBLE_DEVICES=""
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  git \
8
  git-lfs \
9
  && git lfs install \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Install python requirements
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # --- THE BUILD-TIME SECRET MOUNT ---
17
+ # This line accesses your HF_TOKEN secret to download the model
18
+ RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
19
+ huggingface-cli download CooLLaMACEO/Overflow-100B \
20
+ --token $(cat /run/secrets/HF_TOKEN) \
 
 
21
  --local-dir /app/model \
22
  --local-dir-use-symlinks False \
23
+ --exclude "README.md" ".gitattributes"
 
24
 
25
+ # Copy the rest of your app code
26
+ COPY . .
27
 
28
  # Force CPU mode
29
  ENV CUDA_VISIBLE_DEVICES=""