Spaces:
Runtime error
Runtime error
Commit
·
2c3772a
1
Parent(s):
a3bdf98
add build step
Browse files- Dockerfile +11 -11
- docker-compose.yml +14 -0
- sources/csv/connection.yaml +0 -3
- sources/csv/hi.csv +0 -6
Dockerfile
CHANGED
@@ -2,16 +2,16 @@ FROM ubuntu:22.04
|
|
2 |
|
3 |
# Install Node.js 20 - https://github.com/nodesource/distributions?tab=readme-ov-file#installation-instructions-deb
|
4 |
# And python3
|
5 |
-
RUN apt update
|
6 |
-
apt install -y curl python3 python3-pip
|
7 |
-
rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
-
RUN curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
|
10 |
-
bash nodesource_setup.sh
|
11 |
-
apt update
|
12 |
-
apt install -y nodejs
|
13 |
-
rm -rf /var/lib/apt/lists/*
|
14 |
-
rm nodesource_setup.sh
|
15 |
|
16 |
RUN pip install --upgrade "huggingface_hub[cli]"
|
17 |
|
@@ -29,10 +29,10 @@ RUN npm run sources && npm run build
|
|
29 |
ARG STATIC_SPACE
|
30 |
## The Hugging Face token must be passed as a secret (https://huggingface.co/docs/hub/spaces-sdks-docker#buildtime)
|
31 |
## 1. get README.md from the site space
|
32 |
-
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true
|
33 |
huggingface-cli download --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space --local-dir=/usr/app/build $STATIC_SPACE README.md && rm -rf /usr/app/build/.cache
|
34 |
## 2. upload the new build to the site space, including README.md
|
35 |
-
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true
|
36 |
huggingface-cli upload --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space $STATIC_SPACE /usr/app/build . --delete "*"
|
37 |
|
38 |
## Halt execution because the code space is not meant to run.
|
|
|
2 |
|
3 |
# Install Node.js 20 - https://github.com/nodesource/distributions?tab=readme-ov-file#installation-instructions-deb
|
4 |
# And python3
|
5 |
+
RUN apt update \
|
6 |
+
&& apt install -y curl python3 python3-pip \
|
7 |
+
&& rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh \
|
10 |
+
&& bash nodesource_setup.sh \
|
11 |
+
&& apt update \
|
12 |
+
&& apt install -y nodejs \
|
13 |
+
&& rm -rf /var/lib/apt/lists/* \
|
14 |
+
&& rm nodesource_setup.sh
|
15 |
|
16 |
RUN pip install --upgrade "huggingface_hub[cli]"
|
17 |
|
|
|
29 |
ARG STATIC_SPACE
|
30 |
## The Hugging Face token must be passed as a secret (https://huggingface.co/docs/hub/spaces-sdks-docker#buildtime)
|
31 |
## 1. get README.md from the site space
|
32 |
+
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
|
33 |
huggingface-cli download --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space --local-dir=/usr/app/build $STATIC_SPACE README.md && rm -rf /usr/app/build/.cache
|
34 |
## 2. upload the new build to the site space, including README.md
|
35 |
+
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
|
36 |
huggingface-cli upload --token=$(cat /run/secrets/HF_TOKEN) --repo-type=space $STATIC_SPACE /usr/app/build . --delete "*"
|
37 |
|
38 |
## Halt execution because the code space is not meant to run.
|
docker-compose.yml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: '3.8'
|
2 |
+
|
3 |
+
services:
|
4 |
+
app:
|
5 |
+
build:
|
6 |
+
context: .
|
7 |
+
dockerfile: Dockerfile
|
8 |
+
ports:
|
9 |
+
- "3000:3000"
|
10 |
+
volumes:
|
11 |
+
- .:/app
|
12 |
+
- /app/node_modules
|
13 |
+
environment:
|
14 |
+
- NODE_ENV=production
|
sources/csv/connection.yaml
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
name: csv
|
2 |
-
type: csv
|
3 |
-
options: {}
|
|
|
|
|
|
|
|
sources/csv/hi.csv
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
Name,Age
|
2 |
-
John,32
|
3 |
-
Sarah,28
|
4 |
-
Michael,45
|
5 |
-
Emily,39
|
6 |
-
David,52
|
|
|
|
|
|
|
|
|
|
|
|
|
|