Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +4 -12
Dockerfile
CHANGED
@@ -2,13 +2,12 @@ FROM docker.io/nvidia/cuda:12.2.2-runtime-ubuntu22.04
|
|
2 |
|
3 |
USER root
|
4 |
|
5 |
-
# Set environment variables for cache directories
|
6 |
ENV MPLCONFIGDIR=/tmp/matplotlib \
|
7 |
TRANSFORMERS_CACHE=/tmp/huggingface \
|
8 |
HUGGINGFACE_HUB_CACHE=/tmp/huggingface \
|
9 |
DEBIAN_FRONTEND=noninteractive
|
10 |
|
11 |
-
# Install system dependencies
|
12 |
RUN chmod 1777 /tmp \
|
13 |
&& apt-get update -q \
|
14 |
&& apt-get install -y --no-install-recommends \
|
@@ -19,29 +18,22 @@ RUN chmod 1777 /tmp \
|
|
19 |
python3-pip \
|
20 |
libglib2.0-0 \
|
21 |
git \
|
22 |
-
|
23 |
-
&&
|
24 |
-
&&
|
25 |
-
&& rm libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
|
26 |
-
# Install CUDA repositories
|
27 |
&& wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
|
28 |
&& dpkg -i /tmp/cuda-keyring.deb \
|
29 |
&& apt-get update -q \
|
30 |
&& apt-get install -y --no-install-recommends \
|
31 |
libcudnn8 \
|
32 |
libcublas-12-2 \
|
33 |
-
# Clean up
|
34 |
&& apt-get clean \
|
35 |
&& rm -rf /var/lib/apt/lists/* \
|
36 |
-
# Create cache directories
|
37 |
&& mkdir -p ${MPLCONFIGDIR} ${TRANSFORMERS_CACHE} \
|
38 |
&& chmod -R 777 /tmp
|
39 |
|
40 |
-
# Install Python dependencies
|
41 |
COPY requirements.txt .
|
42 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
43 |
|
44 |
-
# Copy application code
|
45 |
COPY main.py .
|
46 |
-
|
47 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
2 |
|
3 |
USER root
|
4 |
|
|
|
5 |
ENV MPLCONFIGDIR=/tmp/matplotlib \
|
6 |
TRANSFORMERS_CACHE=/tmp/huggingface \
|
7 |
HUGGINGFACE_HUB_CACHE=/tmp/huggingface \
|
8 |
DEBIAN_FRONTEND=noninteractive
|
9 |
|
10 |
+
# Install system dependencies with correct OpenSSL 1.1 URL
|
11 |
RUN chmod 1777 /tmp \
|
12 |
&& apt-get update -q \
|
13 |
&& apt-get install -y --no-install-recommends \
|
|
|
18 |
python3-pip \
|
19 |
libglib2.0-0 \
|
20 |
git \
|
21 |
+
&& wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb \
|
22 |
+
&& dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb \
|
23 |
+
&& rm libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb \
|
|
|
|
|
24 |
&& wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
|
25 |
&& dpkg -i /tmp/cuda-keyring.deb \
|
26 |
&& apt-get update -q \
|
27 |
&& apt-get install -y --no-install-recommends \
|
28 |
libcudnn8 \
|
29 |
libcublas-12-2 \
|
|
|
30 |
&& apt-get clean \
|
31 |
&& rm -rf /var/lib/apt/lists/* \
|
|
|
32 |
&& mkdir -p ${MPLCONFIGDIR} ${TRANSFORMERS_CACHE} \
|
33 |
&& chmod -R 777 /tmp
|
34 |
|
|
|
35 |
COPY requirements.txt .
|
36 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
37 |
|
|
|
38 |
COPY main.py .
|
|
|
39 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|