Spaces:
Runtime error
Runtime error
# 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"] | |