File size: 1,115 Bytes
a2e5843
 
f28a148
 
 
a2e5843
f28a148
 
 
 
 
 
 
 
 
 
 
 
 
 
a2e5843
 
 
 
 
 
f28a148
a2e5843
91616c1
 
a2e5843
f28a148
 
a2e5843
 
 
0362c93
edd4636
 
 
0362c93
 
f28a148
 
a2e5843
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM node:19

# Change node user to 1001 to free up uid 1000
RUN groupmod -g 1001 node \
  && usermod -u 1001 -g 1001 node

# Set up a new user named "user" with user ID 1000 per HF instructions
RUN useradd -m -u 1000 user

# Set home to the user's home directory
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app
RUN chmod 777 $HOME/app

COPY --chown=user indie_label_svelte ./indie_label_svelte/
COPY --chown=user *.py .
COPY --chown=user *.sh .
COPY requirements.txt .

RUN apt-get update \
	&& apt install -y python3-pip \
	&& pip3 install -r requirements.txt

WORKDIR $HOME/app/indie_label_svelte
RUN npm install --global rollup \
	&& npm install --save-dev svelte rollup-plugin-svelte --legacy-peer-deps \
	&& npm run build

WORKDIR $HOME/app/
USER user
ENV HOST=0.0.0.0
EXPOSE 5001

# Download data from Google Drive
RUN gdown 1js0HAwBpEcoRdT9nkGY0Mc5Falkpsonl \
	&& unzip data_24_01.zip \
	&& rm data_24_01.zip \
	# Download Sentence Transformers model
	&& python3 cache_model.py 

ENTRYPOINT bash run_app.sh