improved dockerfile
Browse files- Dockerfile +12 -7
Dockerfile
CHANGED
@@ -1,5 +1,16 @@
|
|
1 |
FROM python:3.9
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
RUN useradd -m -u 1000 user
|
4 |
USER user
|
5 |
ENV PATH="/home/user/.local/bin:$PATH"
|
@@ -9,15 +20,9 @@ WORKDIR /app
|
|
9 |
COPY --chown=user ./requirements.txt requirements.txt
|
10 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
11 |
|
12 |
-
RUN apt-get update && apt-get install git -y && apt-get install curl -y
|
13 |
-
RUN curl -fsSL https://ollama.com/install.sh | sh
|
14 |
-
|
15 |
-
# Ensure `ollama` is installed
|
16 |
-
RUN python -m pip show ollama
|
17 |
|
18 |
-
# Copy the application code
|
19 |
COPY --chown=user . /app
|
20 |
-
|
21 |
COPY --chown=user ./startup.sh /app/startup.sh
|
22 |
RUN chmod +x /app/startup.sh
|
23 |
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
|
4 |
+
# Install system dependencies as root
|
5 |
+
RUN apt-get update && \
|
6 |
+
apt-get install -y git curl && \
|
7 |
+
apt-get clean && \
|
8 |
+
rm -rf /var/lib/apt/lists/*
|
9 |
+
|
10 |
+
# Install Ollama
|
11 |
+
RUN curl -fsSL https://ollama.com/install.sh | sh
|
12 |
+
|
13 |
+
|
14 |
RUN useradd -m -u 1000 user
|
15 |
USER user
|
16 |
ENV PATH="/home/user/.local/bin:$PATH"
|
|
|
20 |
COPY --chown=user ./requirements.txt requirements.txt
|
21 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
22 |
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
# Copy the application code and startup script
|
25 |
COPY --chown=user . /app
|
|
|
26 |
COPY --chown=user ./startup.sh /app/startup.sh
|
27 |
RUN chmod +x /app/startup.sh
|
28 |
|