aydayya
commited on
Commit
·
5337a1e
1
Parent(s):
590afda
add files
Browse files- Dockerfile +18 -13
Dockerfile
CHANGED
@@ -1,26 +1,31 @@
|
|
1 |
-
# Use Python 3.9 image as a base
|
2 |
FROM python:3.9
|
3 |
|
4 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
RUN useradd -m -u 1000 user
|
6 |
-
USER user
|
7 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
8 |
|
9 |
-
# Set the working directory
|
10 |
WORKDIR /app
|
11 |
|
12 |
-
# Install dependencies
|
13 |
COPY --chown=user ./requirements.txt requirements.txt
|
14 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
15 |
|
16 |
-
# Copy
|
17 |
COPY --chown=user . /app
|
18 |
|
19 |
-
#
|
20 |
-
EXPOSE 7860
|
21 |
-
|
22 |
-
# Pull the model 'mohamedo/bignova' using Ollama
|
23 |
RUN python -c "import subprocess; subprocess.run(['ollama', 'pull', 'mohamedo/bignova'], check=True)"
|
24 |
|
25 |
-
#
|
26 |
-
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
# Install ollama tool
|
4 |
+
RUN apt-get update && apt-get install -y \
|
5 |
+
curl \
|
6 |
+
&& curl -sSL https://ollama.com/ollama-ubuntu.deb -o ollama.deb \
|
7 |
+
&& dpkg -i ollama.deb \
|
8 |
+
&& rm ollama.deb \
|
9 |
+
&& apt-get clean
|
10 |
+
|
11 |
+
# Create user
|
12 |
RUN useradd -m -u 1000 user
|
|
|
|
|
13 |
|
14 |
+
# Set the working directory
|
15 |
WORKDIR /app
|
16 |
|
17 |
+
# Install dependencies
|
18 |
COPY --chown=user ./requirements.txt requirements.txt
|
19 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
20 |
|
21 |
+
# Copy the rest of the application code
|
22 |
COPY --chown=user . /app
|
23 |
|
24 |
+
# Pull the model
|
|
|
|
|
|
|
25 |
RUN python -c "import subprocess; subprocess.run(['ollama', 'pull', 'mohamedo/bignova'], check=True)"
|
26 |
|
27 |
+
# Expose port for FastAPI
|
28 |
+
EXPOSE 8000
|
29 |
+
|
30 |
+
# Start FastAPI app
|
31 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|