OmniPar / Dockerfile
banao-tech's picture
Update Dockerfile
2b578c8 verified
raw
history blame
1.52 kB
FROM docker.io/nvidia/cuda:12.2.2-runtime-ubuntu22.04
USER root
# Set environment variables for cache directories
ENV MPLCONFIGDIR=/tmp/matplotlib \
TRANSFORMERS_CACHE=/tmp/huggingface \
HUGGINGFACE_HUB_CACHE=/tmp/huggingface \
DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN chmod 1777 /tmp \
&& apt-get update -q \
&& apt-get install -y --no-install-recommends \
ca-certificates \
wget \
libgl1 \
python3 \
python3-pip \
libglib2.0-0 \
git \
# Install OpenSSL 1.1
&& wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
&& dpkg -i libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
&& rm libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
# Install CUDA repositories
&& wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
&& dpkg -i /tmp/cuda-keyring.deb \
&& apt-get update -q \
&& apt-get install -y --no-install-recommends \
libcudnn8 \
libcublas-12-2 \
# Clean up
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
# Create cache directories
&& mkdir -p ${MPLCONFIGDIR} ${TRANSFORMERS_CACHE} \
&& chmod -R 777 /tmp
# Install Python dependencies
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy application code
COPY main.py .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]