brendon-ai commited on
Commit
77b4dba
·
verified ·
1 Parent(s): 1f9f492

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -6
Dockerfile CHANGED
@@ -15,6 +15,7 @@ RUN apt-get update && apt-get install -y \
15
  python3-venv \
16
  wget \
17
  ca-certificates \
 
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
  # Create and activate virtual environment
@@ -29,10 +30,9 @@ RUN pip install --no-cache-dir --upgrade pip && \
29
  # Install Ollama
30
  RUN curl -fsSL https://ollama.ai/install.sh | sh
31
 
32
- # Create ollama user and directories
33
- RUN useradd -m -s /bin/bash ollama && \
34
- mkdir -p /home/ollama/.ollama && \
35
- chown -R ollama:ollama /home/ollama/.ollama
36
 
37
  # Copy application files
38
  COPY app.py .
@@ -41,9 +41,10 @@ COPY startup.sh .
41
  # Make startup script executable
42
  RUN chmod +x startup.sh
43
 
44
- # Set environment variables
45
  ENV OLLAMA_HOST=0.0.0.0:11434
46
- ENV OLLAMA_MODELS=/home/ollama/.ollama/models
 
47
 
48
  # Expose ports
49
  EXPOSE 7860 11434
 
15
  python3-venv \
16
  wget \
17
  ca-certificates \
18
+ sudo \
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
  # Create and activate virtual environment
 
30
  # Install Ollama
31
  RUN curl -fsSL https://ollama.ai/install.sh | sh
32
 
33
+ # Create app directory and set permissions
34
+ RUN mkdir -p /app/.ollama && \
35
+ chmod 755 /app/.ollama
 
36
 
37
  # Copy application files
38
  COPY app.py .
 
41
  # Make startup script executable
42
  RUN chmod +x startup.sh
43
 
44
+ # Set environment variables for Ollama
45
  ENV OLLAMA_HOST=0.0.0.0:11434
46
+ ENV OLLAMA_MODELS=/app/.ollama/models
47
+ ENV OLLAMA_HOME=/app/.ollama
48
 
49
  # Expose ports
50
  EXPOSE 7860 11434