alibidaran commited on
Commit
6d55b2c
·
verified ·
1 Parent(s): a8f4608

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -25
Dockerfile CHANGED
@@ -3,28 +3,15 @@ FROM python:3.10-slim
3
 
4
  # Install dependencies for Ollama
5
  #RUN apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/*
6
-
 
7
  # Install Ollama server
8
  # Set working directory for the app
 
 
 
9
  WORKDIR /app
10
 
11
- # Create a directory for Ollama
12
- RUN apt-get update && apt-get install -y \
13
- curl \
14
- build-essential \
15
- libffi-dev \
16
- cmake \
17
- libcurl4-openssl-dev \
18
- tini && \
19
- apt-get clean
20
-
21
- # Upgrade pip and install dependencies
22
- RUN python -m venv venv && \
23
- . /app/venv/bin/activate && \
24
- pip install --upgrade pip && \
25
- pip install gradio && \
26
- pip install llama-cpp-python
27
-
28
  # Install Ollama
29
  #RUN curl https://ollama.ai/install.sh | sh
30
 
@@ -38,13 +25,13 @@ RUN python -m venv venv && \
38
  COPY . /app
39
 
40
  # Install Python dependencies
 
 
 
 
41
 
42
- # Expose ports for Gradio and Ollama
43
- EXPOSE 7860
44
-
45
- # Start both services using a script
46
- COPY start_services.sh /app/start_services.sh
47
- RUN chmod +x /app/start_services.sh
48
 
49
  # Run the start_services.sh script
50
- CMD ["/app/start_services.sh"]
 
3
 
4
  # Install dependencies for Ollama
5
  #RUN apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/*
6
+ RUN apk update && apk add wget build-base python3-dev musl-dev linux-headers
7
+ RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
8
  # Install Ollama server
9
  # Set working directory for the app
10
+ RUN mkdir app
11
+ COPY . /app
12
+ RUN chmod -R 777 /app
13
  WORKDIR /app
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  # Install Ollama
16
  #RUN curl https://ollama.ai/install.sh | sh
17
 
 
25
  COPY . /app
26
 
27
  # Install Python dependencies
28
+ RUN mkdir -p /.cache/huggingface/hub -m 777
29
+ RUN mkdir -p /.config/matplotlib -m 777
30
+ RUN chmod -R 777 /.cache
31
+ RUN chmod -R 777 /.config
32
 
33
+ # Updating pip and installing everything from requirements
34
+ RUN python3 -m pip install -U pip setuptools wheel
 
 
 
 
35
 
36
  # Run the start_services.sh script
37
+ CMD ["python","app.py"]