Dharini Baskaran commited on
Commit
8923735
·
1 Parent(s): 873ac58

updating docker

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -24
Dockerfile CHANGED
@@ -1,36 +1,32 @@
1
- # Use Python base image
2
- FROM python:3.10-slim
3
-
4
- # Set working directory
5
- WORKDIR /app
6
 
7
  # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  git \
10
- build-essential \
11
- libgl1-mesa-glx \
12
  libglib2.0-0 \
 
 
 
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Install Python dependencies
16
- COPY requirements.txt .
17
- RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Clone and install Detectron2
20
- RUN pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu
21
- RUN git clone https://github.com/facebookresearch/detectron2.git && \
22
- pip install -e detectron2
23
 
24
- # Copy your app code
25
- COPY . .
26
 
27
- # Expose Streamlit default port
28
- EXPOSE 7860
 
29
 
30
- # Streamlit Environment Variables
31
- ENV STREAMLIT_SERVER_PORT=7860
32
- ENV STREAMLIT_SERVER_HEADLESS=true
33
- ENV STREAMLIT_SERVER_ENABLECORS=false
34
 
35
- # Command to run the app
36
- CMD ["streamlit", "run", "app.py"]
 
1
+ # Use Python 3.9 image
2
+ FROM python:3.9-slim
 
 
 
3
 
4
  # Install system dependencies
5
  RUN apt-get update && apt-get install -y \
6
  git \
7
+ gcc \
 
8
  libglib2.0-0 \
9
+ libsm6 \
10
+ libxext6 \
11
+ libxrender-dev \
12
+ ffmpeg \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Install PyTorch (CPU version)
16
+ RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
 
17
 
18
+ # Install other Python dependencies
19
+ RUN pip install opencv-python Pillow gdown gradio pycocotools scikit-image shapely
 
 
20
 
21
+ # Install detectron2 from GitHub
22
+ RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
23
 
24
+ # Copy your project files
25
+ COPY . /app
26
+ WORKDIR /app
27
 
28
+ # Set environment variable to avoid matplotlib error
29
+ ENV MPLCONFIGDIR=/tmp/matplotlib
 
 
30
 
31
+ # Run Gradio app
32
+ CMD ["python3", "app.py"]