-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
44 lines (35 loc) · 1.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM nvidia/cuda:12.4.0-devel-ubuntu22.04
# Prevent interactive prompts during build
ARG DEBIAN_FRONTEND=noninteractive
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.10 \
python3-pip \
python3-dev \
git \
ffmpeg \
libsm6 \
libxext6 \
libgl1-mesa-glx \
libglib2.0-0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Install Python dependencies first for better caching
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
# actually we found a way to put flash attention inside the requirements.txt
# so we are good, we don't need this anymore:
# RUN pip3 install --no-cache-dir -r requirements_without_flash_attention.txt
# RUN pip3 install wheel setuptools flash-attn --no-build-isolation --no-cache-dir
# Copy application files
COPY . .
# Expose Gradio port
EXPOSE 7860
# Run the application
CMD ["python3", "app.py"]