sandbox338 commited on
Commit
4845115
·
verified ·
1 Parent(s): 9629c65

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -2
Dockerfile CHANGED
@@ -2,6 +2,7 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
@@ -18,16 +19,22 @@ RUN apt-get update && apt-get install -y \
18
  zlib1g-dev \
19
  && rm -rf /var/lib/apt/lists/*
20
 
 
21
  COPY requirements.txt ./
22
  COPY src/ ./src/
23
 
24
- RUN pip install numpy && \
 
 
25
  pip install -r requirements.txt && \
26
  pip install torchvision==0.15.2 && \
27
  pip install 'git+https://github.com/facebookresearch/detectron2.git'
28
 
 
29
  EXPOSE 8501
30
 
31
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
32
 
 
33
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install OS dependencies
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
 
19
  zlib1g-dev \
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
+ # Copy project files
23
  COPY requirements.txt ./
24
  COPY src/ ./src/
25
 
26
+ # Install pip packages
27
+ RUN pip install --upgrade pip && \
28
+ pip install "numpy<2.0" && \
29
  pip install -r requirements.txt && \
30
  pip install torchvision==0.15.2 && \
31
  pip install 'git+https://github.com/facebookresearch/detectron2.git'
32
 
33
+ # Expose Streamlit port
34
  EXPOSE 8501
35
 
36
+ # Health check endpoint
37
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
38
 
39
+ # Start Streamlit app
40
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]