teofizzy commited on
Commit
12b5624
·
1 Parent(s): f9be4bf

install global tools as root user

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -12
Dockerfile CHANGED
@@ -2,35 +2,34 @@
2
  FROM python:3.10-slim
3
 
4
  # 1. Install system tools (curl for Ollama, git for data cloning)
 
5
  RUN apt-get update && apt-get install -y \
6
  curl \
7
  git \
8
  build-essential \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # 2. Setup User (Hugging Face Requirement)
 
 
 
 
12
  RUN useradd -m -u 1000 user
13
  USER user
14
  ENV HOME=/home/user \
15
  PATH=/home/user/.local/bin:$PATH
16
- WORKDIR $HOME/app
17
 
18
- # 3. Install Ollama
19
- RUN curl -fsSL https://ollama.com/install.sh | sh
20
 
21
- # 4. Install Python Requirements
22
  COPY --chown=user requirements.txt $HOME/app/
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
- # 5. Copy Application Code
26
  COPY --chown=user . $HOME/app
27
 
28
- # 6. STARTUP COMMAND
29
- # A. Clone Data from Dataset Repo
30
- # B. Move Data to root (so src/app.py can find it easily)
31
- # C. Start Ollama Server
32
- # D. Pull Models (7b fits in 16GB RAM)
33
- # E. Run Streamlit pointing to src/app.py
34
  CMD git clone https://huggingface.co/datasets/teofizzy/mshauri-data data_download && \
35
  mv data_download/mshauri_fedha_v6.db . && \
36
  mv data_download/mshauri_fedha_chroma_db . && \
 
2
  FROM python:3.10-slim
3
 
4
  # 1. Install system tools (curl for Ollama, git for data cloning)
5
+ # (We are still ROOT here, which is correct)
6
  RUN apt-get update && apt-get install -y \
7
  curl \
8
  git \
9
  build-essential \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # 2. Install Ollama (Must be done as ROOT)
13
+ # We do this BEFORE creating/switching to the 'user'
14
+ RUN curl -fsSL https://ollama.com/install.sh | sh
15
+
16
+ # 3. Setup User (Hugging Face Requirement)
17
  RUN useradd -m -u 1000 user
18
  USER user
19
  ENV HOME=/home/user \
20
  PATH=/home/user/.local/bin:$PATH
 
21
 
22
+ # 4. Set Working Directory
23
+ WORKDIR $HOME/app
24
 
25
+ # 5. Install Python Requirements
26
  COPY --chown=user requirements.txt $HOME/app/
27
  RUN pip install --no-cache-dir -r requirements.txt
28
 
29
+ # 6. Copy Application Code
30
  COPY --chown=user . $HOME/app
31
 
32
+ # 7. STARTUP COMMAND
 
 
 
 
 
33
  CMD git clone https://huggingface.co/datasets/teofizzy/mshauri-data data_download && \
34
  mv data_download/mshauri_fedha_v6.db . && \
35
  mv data_download/mshauri_fedha_chroma_db . && \