Spaces:
Starting
on
T4
Starting
on
T4
File size: 1,556 Bytes
d111f0e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# 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"] |