qwgyuz86 commited on
Commit
ea3994a
·
verified ·
1 Parent(s): 40d20a3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -7
Dockerfile CHANGED
@@ -3,7 +3,17 @@ FROM python:3.9
3
 
4
  RUN useradd -m -u 1000 user
5
  USER user
6
- ENV PATH="/home/user/.local/bin:$PATH"
 
 
 
 
 
 
 
 
 
 
7
 
8
  # Set environment variables
9
  ENV EMBED_DEVICE_CHOICE="cpu" \
@@ -12,16 +22,11 @@ ENV EMBED_DEVICE_CHOICE="cpu" \
12
  # Install system dependencies
13
  RUN apt-get update && \
14
  apt-get install -y curl && \
15
- apt-get clean && rm -rf /var/lib/apt/lists/*
16
 
17
  # Install Ollama
18
  RUN curl -fsSL https://ollama.com/install.sh | sh
19
 
20
- # Create app directory
21
- WORKDIR /app
22
-
23
- # Copy application files
24
- COPY --chown=user . /app
25
 
26
  # Install Python dependencies
27
  COPY --chown=user ./requirements.txt requirements.txt
 
3
 
4
  RUN useradd -m -u 1000 user
5
  USER user
6
+ ENV HOME=/home/user \
7
+ PATH="/home/user/.local/bin:$PATH"
8
+
9
+ # Create app directory
10
+ WORKDIR $HOME/app
11
+
12
+ # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
13
+ RUN pip install --no-cache-dir --upgrade pip
14
+
15
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
16
+ COPY --chown=user . $HOME/app
17
 
18
  # Set environment variables
19
  ENV EMBED_DEVICE_CHOICE="cpu" \
 
22
  # Install system dependencies
23
  RUN apt-get update && \
24
  apt-get install -y curl && \
25
+ # apt-get clean && rm -rf /var/lib/apt/lists/*
26
 
27
  # Install Ollama
28
  RUN curl -fsSL https://ollama.com/install.sh | sh
29
 
 
 
 
 
 
30
 
31
  # Install Python dependencies
32
  COPY --chown=user ./requirements.txt requirements.txt