Spaces:
Build error
Build error
add missing README file
Browse files- Dockerfile +4 -4
Dockerfile
CHANGED
|
@@ -20,14 +20,14 @@ WORKDIR /tmp/app
|
|
| 20 |
COPY svelte-demo/ ./
|
| 21 |
RUN npm ci && npm rebuild && npm run build
|
| 22 |
|
| 23 |
-
# The
|
| 24 |
# https://huggingface.co/docs/hub/spaces-sdks-docker#buildtime
|
| 25 |
ARG STATIC_SPACE
|
| 26 |
# The Hugging Face token must be passed as a secret (https://huggingface.co/docs/hub/spaces-sdks-docker#buildtime)
|
| 27 |
-
# 1. get README.md from the
|
| 28 |
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
|
| 29 |
-
huggingface-cli download --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space --local-dir
|
| 30 |
-
# 2. upload the new build to the
|
| 31 |
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
|
| 32 |
huggingface-cli upload --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space $STATIC_SPACE /tmp/app/dist . --delete "*"
|
| 33 |
|
|
|
|
| 20 |
COPY svelte-demo/ ./
|
| 21 |
RUN npm ci && npm rebuild && npm run build
|
| 22 |
|
| 23 |
+
# The site space name must be passed as an environment variable
|
| 24 |
# https://huggingface.co/docs/hub/spaces-sdks-docker#buildtime
|
| 25 |
ARG STATIC_SPACE
|
| 26 |
# The Hugging Face token must be passed as a secret (https://huggingface.co/docs/hub/spaces-sdks-docker#buildtime)
|
| 27 |
+
# 1. get README.md from the site space
|
| 28 |
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
|
| 29 |
+
huggingface-cli download --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space --local-dir=/tmp/app/dist $STATIC_SPACE README.md && rm -rf /tmp/app/dist/.cache
|
| 30 |
+
# 2. upload the new build to the site space, including README.md
|
| 31 |
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
|
| 32 |
huggingface-cli upload --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space $STATIC_SPACE /tmp/app/dist . --delete "*"
|
| 33 |
|