Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +10 -13
Dockerfile
CHANGED
|
@@ -2,31 +2,28 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install
|
| 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 |
-
#
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 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
|
| 29 |
-
COPY
|
| 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=""
|