Spaces:
Build error
Build error
Upload Dockerfile
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
@@ -3,33 +3,33 @@ FROM python:3.9
|
|
3 |
|
4 |
# Install curl
|
5 |
RUN apt-get update && apt-get install -y curl
|
|
|
6 |
|
7 |
# # Create a new user with a home directory and set the user ID
|
8 |
-
|
9 |
|
10 |
# # Switch to the new user
|
11 |
-
|
12 |
|
13 |
# # Set the PATH environment variable to include the user's local bin directory
|
14 |
-
|
15 |
|
16 |
# # Set the working directory to /app
|
17 |
-
|
18 |
|
19 |
# # Copy the requirements.txt file and install the dependencies
|
20 |
-
|
21 |
-
|
22 |
|
23 |
# # Copy the rest of the application code to the /app directory
|
24 |
-
|
25 |
|
26 |
# Install Ollama
|
27 |
-
RUN curl -fsSL https://ollama.com/install.sh | sh
|
28 |
|
29 |
# Create the directory and give appropriate permissions
|
30 |
-
RUN mkdir -p /.app && chmod 777 /.app
|
31 |
|
32 |
-
WORKDIR /.app
|
33 |
|
34 |
# Copy the entry point script
|
35 |
COPY entry.sh /entry.sh
|
|
|
3 |
|
4 |
# Install curl
|
5 |
RUN apt-get update && apt-get install -y curl
|
6 |
+
RUN curl -fsSL https://ollama.com/install.sh | sh
|
7 |
|
8 |
# # Create a new user with a home directory and set the user ID
|
9 |
+
RUN useradd -m -u 1000 user
|
10 |
|
11 |
# # Switch to the new user
|
12 |
+
USER user
|
13 |
|
14 |
# # Set the PATH environment variable to include the user's local bin directory
|
15 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
16 |
|
17 |
# # Set the working directory to /app
|
18 |
+
WORKDIR /app
|
19 |
|
20 |
# # Copy the requirements.txt file and install the dependencies
|
21 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
22 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
23 |
|
24 |
# # Copy the rest of the application code to the /app directory
|
25 |
+
COPY --chown=user . /app
|
26 |
|
27 |
# Install Ollama
|
|
|
28 |
|
29 |
# Create the directory and give appropriate permissions
|
30 |
+
# RUN mkdir -p /.app && chmod 777 /.app
|
31 |
|
32 |
+
# WORKDIR /.app
|
33 |
|
34 |
# Copy the entry point script
|
35 |
COPY entry.sh /entry.sh
|