-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 1.11 KB
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
FROM vllm/vllm-openai:v0.8.2 AS dev
# Install Python 3.11
RUN apt-get update -y && \
apt-get install -y --no-install-recommends python3.11 python3.11-venv python3-pip python3.11-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Ensure Python 3.11 is default
RUN ln -sf /usr/bin/python3.11 /usr/bin/python
ENV GRADIO_SERVER_PORT=7860
ENV GRADIO_SERVER_NAME="0.0.0.0"
EXPOSE 7860
WORKDIR /app
# Create and activate virtual environment
RUN python -m venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
# Install dependencies
COPY requirements.txt setup.py README.md /app/
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY docext /app/docext
# Install application
RUN pip install --no-cache-dir -e .
# Install flash-attn separately
RUN pip install --no-cache-dir flash-attn --no-build-isolation
# Set working directory and entrypoint
WORKDIR /app/
RUN adduser --disabled-password --gecos '' --shell /bin/bash appuser
USER appuser
ENTRYPOINT ["/app/.venv/bin/python", "-m", "docext.app.app", "--no-share", "--ui_port", "7860"]