forked from vllm-project/router
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.router
More file actions
55 lines (40 loc) · 1.27 KB
/
Copy pathDockerfile.router
File metadata and controls
55 lines (40 loc) · 1.27 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Dockerfile for vllm-router
FROM rustlang/rust:nightly-bullseye as rust-builder
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy Rust source files
COPY Cargo.toml Cargo.lock ./
COPY src ./src
# Build the Rust binary
RUN cargo build --release
# Python stage with Rust binary
FROM python:3.12-slim-bullseye
# Install system dependencies
RUN apt-get update && apt upgrade -y && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade pip
# Create app directory
WORKDIR /app
# Copy the Rust binary from builder stage
COPY --from=rust-builder /app/target/release/vllm-router /usr/local/bin/vllm-router
# Make it executable
RUN chmod +x /usr/local/bin/vllm-router
# Copy Python source files for Python launcher (optional)
COPY py_src ./py_src
COPY pyproject.toml ./
COPY README.md ./
# Install Python dependencies if using Python launcher
RUN pip install setuptools-rust wheel build requests
# Expose default router port
EXPOSE 8080
# Expose default metrics port
EXPOSE 29000
# Default command to run the router using Rust binary directly
CMD ["vllm-router", "--host", "0.0.0.0", "--port", "8080"]