Spaces:
Build error
Build error
File size: 1,240 Bytes
7e1c00b 7e75579 7e1c00b 7e75579 7e1c00b 7e75579 7e1c00b 7e75579 7e1c00b 7e75579 7e1c00b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
FROM ubuntu:22.04
# Install git, Node.js 22, python3, pip
RUN apt update \
&& apt install -y curl git python3 python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh \
&& bash nodesource_setup.sh \
&& apt update \
&& apt install -y nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& rm nodesource_setup.sh
RUN pip install --upgrade "huggingface_hub[cli]"
# Clone the SesameFlow repo into /tmp/app
WORKDIR /tmp/app
RUN git clone https://github.com/corranmac/SesameFlow.git
# Build the app
WORKDIR /tmp/app/SesameFlow
RUN npm ci && npm rebuild && npm run build
ARG STATIC_SPACE
# 1. get README.md from the site space
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
huggingface-cli download --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space --local-dir=/tmp/app/SesameFlow/dist $STATIC_SPACE README.md \
&& rm -rf /tmp/app/SesameFlow/dist/.cache
# 2. upload the new build to the site space, including README.md
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
huggingface-cli upload --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space $STATIC_SPACE /tmp/app/SesameFlow/dist . --delete "*"
RUN exit 1
|