-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (25 loc) · 883 Bytes
/
Dockerfile
File metadata and controls
29 lines (25 loc) · 883 Bytes
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
# Stage 1: Build UI
FROM node:lts-slim AS ui-builder
RUN corepack enable pnpm
WORKDIR /app
COPY ui/package.json ui/pnpm-lock.yaml ui/
RUN cd ui && pnpm install --frozen-lockfile
COPY ui/ ui/
RUN cd ui && pnpm build
# Stage 2: Build Rust binary
FROM rust:bookworm AS builder
RUN apt-get update && apt-get install -y protobuf-compiler pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY src/ src/
COPY build.rs ./
COPY --from=ui-builder /app/ui/dist ui/dist
RUN cargo build --locked --release
# Stage 3: Runtime (Google Distroless — minimal CVE surface)
# cc-debian12 already includes OpenSSL, CA certificates, and tzdata.
FROM gcr.io/distroless/cc-debian12:nonroot
COPY --from=builder /app/target/release/aisix /usr/local/bin/aisix
COPY config.yaml /etc/aisix/config.yaml
EXPOSE 3000 3001
WORKDIR /etc/aisix
ENTRYPOINT ["aisix"]