riteshraut
commited on
Commit
·
43432c1
1
Parent(s):
57bb94b
fix
Browse files- Dockerfile +9 -4
Dockerfile
CHANGED
|
@@ -13,15 +13,20 @@ RUN apt-get update && apt-get install -y \
|
|
| 13 |
# Create a non-root user early
|
| 14 |
RUN useradd --create-home --shell /bin/bash --uid 1000 appuser
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Add this line to accept the HF_TOKEN secret
|
| 17 |
ARG HF_TOKEN
|
| 18 |
|
| 19 |
-
#
|
| 20 |
RUN huggingface-cli login --token $HF_TOKEN
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
COPY requirements.txt .
|
| 24 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 25 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
|
| 27 |
# Set environment variables for HuggingFace models and cache
|
|
|
|
| 13 |
# Create a non-root user early
|
| 14 |
RUN useradd --create-home --shell /bin/bash --uid 1000 appuser
|
| 15 |
|
| 16 |
+
# Copy and install Python requirements as root first
|
| 17 |
+
COPY requirements.txt .
|
| 18 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 19 |
+
|
| 20 |
+
# Install huggingface-hub first to get the CLI
|
| 21 |
+
RUN pip install --no-cache-dir huggingface-hub
|
| 22 |
+
|
| 23 |
# Add this line to accept the HF_TOKEN secret
|
| 24 |
ARG HF_TOKEN
|
| 25 |
|
| 26 |
+
# Now you can log in
|
| 27 |
RUN huggingface-cli login --token $HF_TOKEN
|
| 28 |
|
| 29 |
+
# Install the rest of your requirements
|
|
|
|
|
|
|
| 30 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 31 |
|
| 32 |
# Set environment variables for HuggingFace models and cache
|