Spaces:
Runtime error
Runtime error
carolanderson
commited on
Commit
•
f28a148
1
Parent(s):
91616c1
Dockerfile for HuggingFace Spaces
Browse files- Dockerfile +24 -8
Dockerfile
CHANGED
@@ -1,28 +1,44 @@
|
|
1 |
FROM node:19
|
2 |
|
3 |
-
|
|
|
|
|
4 |
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
COPY requirements.txt .
|
8 |
-
COPY *.sh .
|
9 |
|
10 |
RUN apt-get update \
|
11 |
&& apt install -y python3-pip \
|
12 |
&& pip3 install -r requirements.txt
|
13 |
|
|
|
14 |
RUN npm install --global rollup \
|
15 |
&& npm install --save-dev svelte rollup-plugin-svelte --legacy-peer-deps \
|
16 |
-
&& cd indie_label_svelte \
|
17 |
&& npm run build
|
18 |
|
|
|
|
|
19 |
ENV HOST=0.0.0.0
|
20 |
EXPOSE 5001
|
21 |
|
22 |
-
|
23 |
&& unzip data.zip \
|
24 |
-
&& rm data.zip
|
25 |
-
|
|
|
26 |
|
27 |
|
28 |
|
|
|
1 |
FROM node:19
|
2 |
|
3 |
+
# Change node user to 1001 to free up uid 1000
|
4 |
+
RUN groupmod -g 1001 node \
|
5 |
+
&& usermod -u 1001 -g 1001 node
|
6 |
|
7 |
+
# Set up a new user named "user" with user ID 1000 per HF instructions
|
8 |
+
RUN useradd -m -u 1000 user
|
9 |
+
|
10 |
+
# Set home to the user's home directory
|
11 |
+
ENV HOME=/home/user \
|
12 |
+
PATH=/home/user/.local/bin:$PATH
|
13 |
+
|
14 |
+
# Set the working directory to the user's home directory
|
15 |
+
WORKDIR $HOME/app
|
16 |
+
RUN chmod 777 $HOME/app
|
17 |
+
|
18 |
+
COPY --chown=user indie_label_svelte ./indie_label_svelte/
|
19 |
+
COPY --chown=user *.py .
|
20 |
+
COPY --chown=user *.sh .
|
21 |
COPY requirements.txt .
|
|
|
22 |
|
23 |
RUN apt-get update \
|
24 |
&& apt install -y python3-pip \
|
25 |
&& pip3 install -r requirements.txt
|
26 |
|
27 |
+
WORKDIR $HOME/app/indie_label_svelte
|
28 |
RUN npm install --global rollup \
|
29 |
&& npm install --save-dev svelte rollup-plugin-svelte --legacy-peer-deps \
|
|
|
30 |
&& npm run build
|
31 |
|
32 |
+
WORKDIR $HOME/app/
|
33 |
+
USER user
|
34 |
ENV HOST=0.0.0.0
|
35 |
EXPOSE 5001
|
36 |
|
37 |
+
RUN gdown 1In9qAzV5t--rMmEH2R5miWpZ4IQStgFu \
|
38 |
&& unzip data.zip \
|
39 |
+
&& rm data.zip
|
40 |
+
|
41 |
+
ENTRYPOINT bash run_app.sh
|
42 |
|
43 |
|
44 |
|