Guhanselvam commited on
Commit
0f8cc03
·
verified ·
1 Parent(s): 5abd0f6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -16
Dockerfile CHANGED
@@ -1,25 +1,28 @@
1
- # Use a slimmer Python image
2
- FROM python:3.10-slim
3
 
4
- # Set the working directory
5
- WORKDIR /home/user/app
6
 
7
- # Install system dependencies
8
- RUN apt-get update && apt-get install -y \
9
- git \
10
- libgl1-mesa-glx \
11
- && apt-get clean \
 
 
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copy the requirements file and install dependencies
15
- COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
- # Copy the application files
19
- COPY app.py .
20
 
21
- # Expose port 5000 for Flask
22
  EXPOSE 5000
 
23
 
24
- # Run the application
25
- CMD ["python", "app.py"]
 
1
+ # Use a suitable base image. This one has Python and some common tools.
2
+ FROM python:3.10-slim-bullseye
3
 
4
+ # Set the working directory inside the container
5
+ WORKDIR /app
6
 
7
+ # Copy requirements file first to leverage Docker's caching
8
+ COPY requirements.txt .
9
+
10
+ # Install system dependencies for Ollama (if needed - check Ollama's instructions)
11
+ RUN apt-get update && \
12
+ apt-get install -y --no-install-recommends \
13
+ curl \
14
+ # Add any other system dependencies Ollama requires here
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Install Python dependencies
 
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Copy the rest of your application code
21
+ COPY . .
22
 
23
+ # Expose the ports (for Flask and Gradio)
24
  EXPOSE 5000
25
+ EXPOSE 7860
26
 
27
+ # Command to run when the container starts. Start Flask first, then Gradio.
28
+ CMD ["bash", "-c", "python api.py & python app.py"]