Spaces:
Sleeping
Sleeping
Dharini Baskaran
commited on
Commit
·
8923735
1
Parent(s):
873ac58
updating docker
Browse files- Dockerfile +20 -24
Dockerfile
CHANGED
|
@@ -1,36 +1,32 @@
|
|
| 1 |
-
# Use Python
|
| 2 |
-
FROM python:3.
|
| 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 |
-
|
| 11 |
-
libgl1-mesa-glx \
|
| 12 |
libglib2.0-0 \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
# Install
|
| 16 |
-
|
| 17 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
RUN pip install
|
| 21 |
-
RUN git clone https://github.com/facebookresearch/detectron2.git && \
|
| 22 |
-
pip install -e detectron2
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
ENV
|
| 32 |
-
ENV STREAMLIT_SERVER_HEADLESS=true
|
| 33 |
-
ENV STREAMLIT_SERVER_ENABLECORS=false
|
| 34 |
|
| 35 |
-
#
|
| 36 |
-
CMD ["
|
|
|
|
| 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"]
|