banao-tech commited on
Commit
574e1e7
·
verified ·
1 Parent(s): 2b578c8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -37
Dockerfile CHANGED
@@ -1,47 +1,25 @@
1
- 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 \
15
- ca-certificates \
16
- wget \
17
- libgl1 \
18
- python3 \
19
- python3-pip \
20
- libglib2.0-0 \
21
- git \
22
- # Install OpenSSL 1.1
23
- && wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
24
- && dpkg -i libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
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"]
 
 
1
+ FROM docker.io/nvidia/cuda:12.2.2-runtime-ubuntu22.04@sha256:94c1577b2cd9dd6c0312dc04dff9cb2fdce2b268018abc3d7c2dbcacf1155000
2
 
3
  USER root
4
 
 
 
 
 
 
 
5
  # Install system dependencies
6
  RUN chmod 1777 /tmp \
7
+ && apt update -q && apt install -y \
8
+ ca-certificates \
9
+ wget \
10
+ libgl1 \
11
+ python3-pip \
12
+ libssl3 \ # Use libssl3 instead of libssl1.1 (if no specific requirement for 1.1)
 
 
 
 
 
 
 
 
13
  && wget -qO /tmp/cuda-keyring.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
14
+ && dpkg -i /tmp/cuda-keyring.deb && apt update -q \
15
+ && apt install -y --no-install-recommends libcudnn8 libcublas-12-2
 
 
 
 
 
 
 
 
 
16
 
17
+ # Install Python packages
18
  COPY requirements.txt .
19
+ RUN pip3 install --no-cache-dir -r requirements.txt
20
 
21
+ # Copy application files
22
+ COPY main.py main.py
23
 
24
+ # Start the application
25
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]