Corran commited on
Commit
7e1c00b
·
verified ·
1 Parent(s): 4927960

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -0
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ # Install git, Node.js 22, python3, pip
4
+ RUN apt update \
5
+ && apt install -y curl git python3 python3-pip \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ RUN curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh \
9
+ && bash nodesource_setup.sh \
10
+ && apt update \
11
+ && apt install -y nodejs \
12
+ && rm -rf /var/lib/apt/lists/* \
13
+ && rm nodesource_setup.sh
14
+
15
+ RUN pip install --upgrade "huggingface_hub[cli]"
16
+
17
+ # Clone the SesameFlow2025 repo into /tmp/app
18
+ WORKDIR /tmp/app
19
+ RUN git clone https://github.com/corranmac/SesameFlow2025.git
20
+
21
+ # Build the app
22
+ WORKDIR /tmp/app/SesameFlow2025
23
+ RUN npm ci && npm rebuild && npm run build
24
+
25
+ ARG STATIC_SPACE
26
+
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/SesameFlow2025/dist $STATIC_SPACE README.md \
30
+ && rm -rf /tmp/app/SesameFlow2025/dist/.cache
31
+
32
+ # 2. upload the new build to the site space, including README.md
33
+ RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
34
+ huggingface-cli upload --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space $STATIC_SPACE /tmp/app/SesameFlow2025/dist . --delete "*"
35
+
36
+ RUN exit 1