Update Dockerfile
Browse files- Dockerfile +18 -2
Dockerfile
CHANGED
@@ -1,8 +1,24 @@
|
|
1 |
# Use the official Python base image
|
2 |
FROM ghcr.io/huggingface/text-embeddings-inference:cpu-0.5
|
3 |
|
4 |
-
#
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Set the default command to run your app
|
8 |
CMD ["--model-id", "BAAI/bge-small-en-v1.5", "--port", "7860"]
|
|
|
1 |
# Use the official Python base image
|
2 |
FROM ghcr.io/huggingface/text-embeddings-inference:cpu-0.5
|
3 |
|
4 |
+
# Set up a new user named "user" with user ID 1000
|
5 |
+
RUN useradd -m -u 1000 user
|
6 |
+
|
7 |
+
# Switch to the "user" user
|
8 |
+
USER 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 |
+
|
17 |
+
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
18 |
+
RUN pip install --no-cache-dir --upgrade pip
|
19 |
+
|
20 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
21 |
+
COPY --chown=user . $HOME/app
|
22 |
|
23 |
# Set the default command to run your app
|
24 |
CMD ["--model-id", "BAAI/bge-small-en-v1.5", "--port", "7860"]
|