alibidaran commited on
Commit
626c860
·
verified ·
1 Parent(s): df4973d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -33
Dockerfile CHANGED
@@ -1,41 +1,23 @@
1
- # Base image for Python
2
- FROM python:3.11.9-alpine3.20
3
 
4
- # Just for sure everything will be fine.
5
- # ALSO ITS BAD! But since its docker, probably.. screw it?
6
- USER root
7
-
8
- # Installing gcc compiler and main library.
9
- RUN apk update && apk add wget build-base python3-dev musl-dev linux-headers
10
- RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
11
- # Install Ollama server
12
- # Set working directory for the app
13
- RUN mkdir app
14
- COPY . /app
15
- RUN chmod -R 777 /app
16
  WORKDIR /app
17
 
18
- # Install Ollama
19
- #RUN curl https://ollama.ai/install.sh | sh
20
-
21
- # Create the directory and give appropriate permissions
22
- #RUN mkdir -p /.ollama && chmod 777 /.ollama
23
 
24
- # Ensure Ollama binary is in the PATH
25
- #ENV PATH="/app/venv/bin:/root/.ollama/bin:$PATH"
 
26
 
27
- # Copy application files and model
28
- COPY . /app
 
29
 
30
- # Install Python dependencies
31
- RUN mkdir -p /.cache/huggingface/hub -m 777
32
- RUN mkdir -p /.config/matplotlib -m 777
33
- RUN chmod -R 777 /.cache
34
- RUN chmod -R 777 /.config
35
 
36
- # Updating pip and installing everything from requirements
37
- RUN python3 -m pip install -U pip setuptools wheel
38
- RUN python3 -m pip install gradio
39
 
40
- # Run the start_services.sh script
41
- CMD ["python","app.py"]
 
1
+ FROM python:3.11-slim
 
2
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && \
7
+ apt-get install -y curl && \
8
+ rm -rf /var/lib/apt/lists/*
 
9
 
10
+ # Copy setup.sh and run it
11
+ COPY setup.sh .
12
+ RUN chmod +x setup.sh && ./setup.sh
13
 
14
+ # Copy requirements and install Python dependencies
15
+ COPY requirements.txt .
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Copy app code
19
+ COPY app.py .
 
 
 
20
 
21
+ EXPOSE 8501
 
 
22
 
23
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]