processoptimisationsystem commited on
Commit
d6ad71f
·
verified ·
1 Parent(s): ba4ee9c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -2
Dockerfile CHANGED
@@ -2,20 +2,29 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
8
  software-properties-common \
9
  git \
10
- && rm -rf /var/lib/apt/lists/*
 
 
 
11
 
 
12
  COPY requirements.txt ./
13
  COPY src/ ./src/
14
 
15
- RUN pip3 install -r requirements.txt
 
16
 
 
17
  EXPOSE 8501
18
 
 
19
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
20
 
 
21
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies for OpenCV and other libraries
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
9
  software-properties-common \
10
  git \
11
+ libgl1-mesa-glx \ # Required for libGL.so.1
12
+ libx11-6 \ # Additional X11 dependencies for OpenCV
13
+ libxext6 \ # Required for some graphical operations
14
+ && rm -rf /var/lib/apt/lists/* # Clean up to reduce image size
15
 
16
+ # Copy application files
17
  COPY requirements.txt ./
18
  COPY src/ ./src/
19
 
20
+ # Install Python dependencies
21
+ RUN pip3 install --no-cache-dir -r requirements.txt
22
 
23
+ # Expose Streamlit port
24
  EXPOSE 8501
25
 
26
+ # Healthcheck for Streamlit
27
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
28
 
29
+ # Run Streamlit
30
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]