kubedocker commited on
Commit
6df8041
1 Parent(s): 66b40fa

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -18
Dockerfile CHANGED
@@ -1,21 +1,4 @@
1
- FROM ghcr.io/huggingface/text-embeddings-inference:cpu-1.2
2
-
3
- RUN useradd -m -u 1000 user
4
-
5
- RUN mkdir -p /data
6
- RUN chown -R user /data
7
- RUN chmod -R 777 /data
8
-
9
- RUN mkdir -p /home/user/.cache/huggingface
10
- RUN chown -R user /home/user/.cache/huggingface
11
- RUN chmod -R 777 /home/user/
12
-
13
- # Switch to the "user" user
14
- USER user
15
-
16
- # Set home to the user's home directory
17
- ENV HOME=/home/user \
18
- PATH=/home/user/.local/bin:$PATH
19
 
20
  ############### NGINX Unprivileged ###############
21
 
@@ -150,6 +133,27 @@ CMD ["nginx", "-g", "daemon off;"]
150
 
151
  ############### NGINX Unprivileged ###############
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  # Set the working directory to the user's home directory
154
  WORKDIR $HOME/app
155
 
 
1
+ FROM ghcr.io/huggingface/text-embeddings-inference:cpu-1.2 AS base
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  ############### NGINX Unprivileged ###############
4
 
 
133
 
134
  ############### NGINX Unprivileged ###############
135
 
136
+ FROM base
137
+
138
+ RUN useradd -m -u 1000 user
139
+
140
+ RUN mkdir -p /data
141
+ RUN chown -R user /data
142
+ RUN chmod -R 777 /data
143
+
144
+ RUN mkdir -p /home/user/.cache/huggingface
145
+ RUN chown -R user /home/user/.cache/huggingface
146
+ RUN chmod -R 777 /home/user/
147
+
148
+ # Switch to the "user" user
149
+ USER user
150
+
151
+ # Set home to the user's home directory
152
+ ENV HOME=/home/user \
153
+ PATH=/home/user/.local/bin:$PATH
154
+
155
+
156
+
157
  # Set the working directory to the user's home directory
158
  WORKDIR $HOME/app
159