forked from phildougherty/qwen2.5-VL-inference-openai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (39 loc) · 1.27 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
45
46
47
48
49
FROM nvidia/cuda:12.3.1-devel-ubuntu22.04
# Set working directory
WORKDIR /app
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV PORT=9192
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=${CUDA_HOME}/bin:${PATH}
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3-pip \
python3-dev \
git \
build-essential \
ninja-build \
curl \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (for better caching)
COPY requirements.txt .
# Install Python packages in specific order
RUN pip3 install --no-cache-dir packaging && \
pip3 install --no-cache-dir --index-url https://download.pytorch.org/whl/cu121 torch torchvision && \
pip3 install --no-cache-dir ninja && \
pip3 install --no-cache-dir flash-attn --no-build-isolation && \
pip3 install --no-cache-dir -r requirements.txt
# Create necessary directories
RUN mkdir -p /app/models /app/webhook_logs
# Copy application code
COPY . .
# Expose port
EXPOSE 9192
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:9192/health || exit 1
# Start the application
CMD ["python3", "app.py"]