Spaces:
Runtime error
Runtime error
File size: 1,274 Bytes
9d5f80a 2617fc1 8ef434b 9d5f80a c402060 9d5f80a e86e816 9d5f80a 0c1a7dc 9d5f80a e86e816 9d5f80a c402060 9d5f80a |
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 |
# Use an official Python runtime as a parent image
FROM python:3.9
# Set the working directory to /code
WORKDIR /code
# Copy the current directory contents into the container at /code
COPY . .
# Install any needed packages specified in requirements.txt
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gnupg \
&& rm -rf /var/lib/apt/lists/*
# Add NVIDIA package repositories
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64/cuda-10-1_10.1.243-1_amd64.deb && \
dpkg -i cuda-10-1_10.1.243-1_amd64.deb && \
rm cuda-10-1_10.1.243-1_amd64.deb && \
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64/7fa2af80.pub && \
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \
apt-get update
# Install CUDA and other dependencies
RUN apt-get install -y --no-install-recommends \
cuda-cudart-10-1 \
cuda-compat-10-1 \
&& rm -rf /var/lib/apt/lists/*
# Install required Python packages
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Run app.py when the container launches
CMD ["python", "caption_api.py", "--host", "0.0.0.0", "--port", "7860"]
|