Files
ssw__ipass/rust/vendor/ngx-rust/Dockerfile
T
admin 5c307ba1aa iPass 山海关:Rust 动态模块版全量入库
- vanilla nginx + Rust 动态模块(取代 OpenResty+Lua),共享内存为运行期真源
- 三域名分流 18098 ssl:mdm 管理台 / lm LLM 代理 / *.dm 企业转发,共用 *.mayishangshu.cn 通配符证书(证书不入库)
- LLM 统一出口:同 Key 鉴权、上游 Key 替换、白名单、限流配额、SSE
- 回归夹具 tests/(网关 55 + LLM 34 = 89 断言,夹具 cp 覆盖重置)
- 文档:readme(16 章)+ CLAUDE.md + conf/tls/README(acme.sh 证书管理、hairpin 环回链路)
2026-09-11 15:37:09 +08:00

52 lines
1.5 KiB
Docker

ARG NGX_VERSION=1.30.4
# NGINX official images are available for one specific release of Debian,
# e.g `nginx:1.30.4-trixie`. Please see the list of tags on Docker Hub
# if you need to change NGX_VERSION.
ARG DEBIAN_RELEASE=trixie
# --- builder: build all examples
FROM rust:slim-${DEBIAN_RELEASE} AS build
ARG NGX_VERSION
ARG NGX_CONFIGURE_ARGS=
WORKDIR /project
RUN --mount=type=cache,target=/var/cache/apt <<EOF
set -eux
export DEBIAN_FRONTEND=noninteractive
apt-get -qq update
apt-get -qq install --yes --no-install-recommends --no-install-suggests \
libclang-dev \
libpcre2-dev \
libssl-dev \
zlib1g-dev \
pkg-config \
git \
grep \
gawk \
gnupg2 \
sed \
make
git config --global --add safe.directory /project
EOF
COPY . .
RUN --mount=type=cache,id=cargo,target=/usr/local/cargo/registry \
cargo fetch --locked
RUN --mount=type=cache,id=target,target=target \
--mount=type=cache,id=cache,target=.cache \
--mount=type=cache,id=cargo,target=/usr/local/cargo/registry \
mkdir -p /out && \
cargo build --release --package examples --examples && \
mv /project/target/release/examples/*.so /out
# --- copy dynamic modules into official nginx image from builderclear
FROM nginx:${NGX_VERSION}-${DEBIAN_RELEASE}
RUN mkdir -p /etc/nginx/examples
COPY --from=build /out/*.so /etc/nginx/modules/
COPY --from=build /project/examples/*.conf /etc/nginx/examples
EXPOSE 8000