Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +5 -3
Dockerfile
CHANGED
@@ -13,9 +13,7 @@ RUN pip install -r requirements.txt
|
|
13 |
# Step 5: Expose the necessary port
|
14 |
EXPOSE 7860
|
15 |
|
16 |
-
|
17 |
-
RUN --mount=type=secret,id=HUGGINGFACE_TOKEN,mode=0444,required=true \
|
18 |
-
echo "HUGGINGFACE_TOKEN=$(cat /run/secrets/HUGGINGFACE_TOKEN)" > .env
|
19 |
|
20 |
# Install huggingface-cli
|
21 |
RUN pip install huggingface_hub
|
@@ -32,6 +30,10 @@ RUN chmod -R 777 /app
|
|
32 |
# Switch to the non-root user
|
33 |
USER myuser
|
34 |
|
|
|
|
|
|
|
|
|
35 |
RUN huggingface-cli login --token $HUGGINGFACE_TOKEN
|
36 |
|
37 |
# Step 6: Define the entry point command
|
|
|
13 |
# Step 5: Expose the necessary port
|
14 |
EXPOSE 7860
|
15 |
|
16 |
+
|
|
|
|
|
17 |
|
18 |
# Install huggingface-cli
|
19 |
RUN pip install huggingface_hub
|
|
|
30 |
# Switch to the non-root user
|
31 |
USER myuser
|
32 |
|
33 |
+
# Expose the secret HUGGINGFACE_TOKEN at buildtime and use its value as the Hugging Face token
|
34 |
+
RUN --mount=type=secret,id=HUGGINGFACE_TOKEN,mode=0444,required=true \
|
35 |
+
echo "HUGGINGFACE_TOKEN=$(cat /run/secrets/HUGGINGFACE_TOKEN)" > .env
|
36 |
+
|
37 |
RUN huggingface-cli login --token $HUGGINGFACE_TOKEN
|
38 |
|
39 |
# Step 6: Define the entry point command
|