heboya8 commited on
Commit
6358317
·
verified ·
1 Parent(s): 1ec55f0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -10
Dockerfile CHANGED
@@ -1,19 +1,29 @@
1
- # Use official Python slim image for a leaner base
2
- FROM python:3.11-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy requirements file first to leverage Docker cache
8
- COPY requirements.txt .
9
-
10
- # Update apt-get with retries and install system dependencies
11
  RUN apt-get update --fix-missing && apt-get install -y --no-install-recommends \
 
 
 
12
  git \
13
  gcc \
14
  build-essential \
15
- libpython3.11-dev \
16
- && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
17
 
18
  # Update pip and install pip-tools
19
  RUN pip install --no-cache-dir --upgrade pip \
@@ -22,8 +32,10 @@ RUN pip install --no-cache-dir --upgrade pip \
22
  # Sync dependencies with pip-sync
23
  RUN pip-sync requirements.txt
24
 
25
- # Install Gradio and LoRA packages
26
- RUN pip install --no-cache-dir gradio
 
 
27
  RUN pip install git+https://github.com/cloneofsimo/lora.git
28
  RUN pip install git+https://github.com/microsoft/LoRA
29
 
 
1
+ # Use NVIDIA CUDA base image for GPU support
2
+ FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install Python 3.11 and necessary tools
 
 
 
8
  RUN apt-get update --fix-missing && apt-get install -y --no-install-recommends \
9
+ python3.11 \
10
+ python3.11-dev \
11
+ python3-pip \
12
  git \
13
  gcc \
14
  build-essential \
15
+ ffmpeg \
16
+ && rm -rf /var/lib/apt/lists/* \
17
+ && ln -sf /usr/bin/python3.11 /usr/bin/python3 \
18
+ && ln -sf /usr/bin/python3.11 /usr/bin/python
19
+
20
+ # Set Hugging Face cache directory
21
+ ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
22
+ ENV HF_HOME=/app/.cache/huggingface
23
+ RUN mkdir -p /app/.cache/huggingface && chmod -R 777 /app/.cache/huggingface
24
+
25
+ # Copy requirements file
26
+ COPY requirements.txt .
27
 
28
  # Update pip and install pip-tools
29
  RUN pip install --no-cache-dir --upgrade pip \
 
32
  # Sync dependencies with pip-sync
33
  RUN pip-sync requirements.txt
34
 
35
+ # Install Gradio, diffusers, and LoRA packages
36
+ RUN pip install --no-cache-dir gradio==4.44.0
37
+ RUN pip install --no-cache-dir diffusers==0.30.3
38
+ RUN pip install --no-cache-dir huggingface_hub==0.25.2
39
  RUN pip install git+https://github.com/cloneofsimo/lora.git
40
  RUN pip install git+https://github.com/microsoft/LoRA
41