Spaces:
Build error
Build error
Upload Dockerfile
Browse files- Dockerfile +32 -20
Dockerfile
CHANGED
@@ -1,32 +1,44 @@
|
|
1 |
# Use the official Python image from the Docker Hub
|
2 |
FROM python:3.9
|
3 |
|
4 |
-
# Install curl
|
5 |
-
RUN apt-get update && apt-get install -y curl
|
6 |
-
&& curl -fsSL https://ollama.com/install.sh | sh \
|
7 |
-
&& rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
-
#
|
10 |
-
RUN
|
11 |
|
12 |
-
#
|
13 |
-
|
14 |
|
15 |
-
#
|
16 |
-
|
17 |
|
18 |
-
# Set the
|
19 |
-
|
20 |
|
21 |
-
#
|
22 |
-
|
|
|
23 |
|
24 |
-
# Copy the
|
25 |
-
COPY --chown=user
|
26 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
27 |
|
28 |
-
#
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
# Set the command to run the application
|
32 |
-
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
1 |
# Use the official Python image from the Docker Hub
|
2 |
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 |
+
# RUN useradd -m -u 1000 user
|
9 |
|
10 |
+
# # Switch to the new user
|
11 |
+
# USER user
|
12 |
|
13 |
+
# # Set the PATH environment variable to include the user's local bin directory
|
14 |
+
# ENV PATH="/home/user/.local/bin:$PATH"
|
15 |
|
16 |
+
# # Set the working directory to /app
|
17 |
+
# WORKDIR /app
|
18 |
|
19 |
+
# # Copy the requirements.txt file and install the dependencies
|
20 |
+
# COPY --chown=user ./requirements.txt requirements.txt
|
21 |
+
# RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
22 |
|
23 |
+
# # Copy the rest of the application code to the /app directory
|
24 |
+
# COPY --chown=user . /app
|
|
|
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 entrypoint.sh /entry.sh
|
36 |
+
RUN chmod +x /entry.sh
|
37 |
+
|
38 |
+
ENTRYPOINT ["/entrypoint.sh"]
|
39 |
+
CMD ["ollama", "serve"]
|
40 |
|
41 |
# Set the command to run the application
|
42 |
+
# CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|
43 |
+
|
44 |
+
EXPOSE 7860
|