Spaces:
Sleeping
Sleeping
# Use the specified Python runtime as a parent image | |
FROM docker.io/library/python:3.10.13@sha256:d5b1fbbc00fd3b55620a9314222498bebf09c4bf606425bf464709ed6a79f202 | |
# Set the working directory in the container | |
WORKDIR /usr/src/app | |
# Install required packages | |
RUN apt-get update && apt-get install -y \ | |
gcc-11 \ | |
build-essential \ | |
ffmpeg \ | |
libsm6 \ | |
libxext6 \ | |
curl \ | |
git \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Install Node.js and npm | |
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \ | |
&& apt-get install -y nodejs | |
# Set environment variable to use gcc-11 | |
ENV CC=/usr/bin/gcc-11 | |
# Copy the current directory contents into the container | |
COPY . . | |
# Install any needed packages specified in requirements.txt | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Set the working directory for the GroundingDINO ops | |
WORKDIR /usr/src/app/models/GroundingDINO/ops | |
# Run the setup script and the test script | |
RUN python setup.py build install | |
RUN python test.py # This should result in 6 lines of * True | |
# Install Gradio | |
RUN pip install gradio | |
# Clone the custom Gradio component repository and build it | |
WORKDIR /usr/src/app | |
RUN git clone https://github.com/niki-amini-naieni/gradio-image-prompter-visible-boxes.git \ | |
&& cd gradio-image-prompter-visible-boxes \ | |
&& npm install \ | |
&& npm run build | |
# Change back to the original working directory | |
WORKDIR /usr/src/app | |
# Expose the port Gradio will run on | |
EXPOSE 7860 | |
# Default command to run the Gradio app | |
CMD ["python", "app.py"] |