20260723 新增 rpki-explorer 单容器部署资产并修复 parsed 投影渲染(#128):deploy/rpki-explorer 全套独立 compose 部署资产(对接 231 在跑 soak、retain 10 runs、SSH 转发访问);ProjectionView 按真实 API 结构解包 projection.object、证书走 resourceCertificate+extensions、CRL 读顶层字段并新增 IP/AS 资源格式化;e2e fixtures 对齐真实嵌套结构并新增证书/CRL parsed 覆盖
This commit is contained in:
68
deploy/rpki-explorer/Dockerfile
Normal file
68
deploy/rpki-explorer/Dockerfile
Normal file
@@ -0,0 +1,68 @@
|
||||
# rpki-explorer all-in-one image:
|
||||
# - rpki_query_service (watch mode) + rpki_query_indexer
|
||||
# - nginx serving the explorer SPA and proxying /api/v1/ to the query service
|
||||
#
|
||||
# Build context must be the repository root (rpki_2/rpki):
|
||||
# docker build -f deploy/rpki-explorer/Dockerfile -t rpki-explorer:<tag> .
|
||||
#
|
||||
# Note: no `# syntax=` directive on purpose — the default images below are all
|
||||
# expected to be present locally, and pulling the dockerfile frontend from
|
||||
# docker.io may not be possible on offline build hosts.
|
||||
|
||||
ARG RUST_BUILDER_IMAGE=rust:1-bookworm
|
||||
ARG NODE_BUILDER_IMAGE=node:slim
|
||||
ARG RUNTIME_IMAGE=nginx:1.27-bookworm
|
||||
|
||||
FROM ${RUST_BUILDER_IMAGE} AS rust-builder
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
clang \
|
||||
cmake \
|
||||
git \
|
||||
libclang-dev \
|
||||
make \
|
||||
perl \
|
||||
pkg-config \
|
||||
python3 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||
--mount=type=cache,target=/usr/local/cargo/git \
|
||||
--mount=type=cache,target=/src/target \
|
||||
cargo build --release --bin rpki_query_service --bin rpki_query_indexer \
|
||||
&& cp target/release/rpki_query_service target/release/rpki_query_indexer /usr/local/bin/
|
||||
|
||||
FROM ${NODE_BUILDER_IMAGE} AS ui-builder
|
||||
|
||||
WORKDIR /ui
|
||||
|
||||
COPY ui/rpki-explorer/package.json ui/rpki-explorer/package-lock.json ./
|
||||
RUN npm ci --no-audit --no-fund
|
||||
|
||||
COPY ui/rpki-explorer/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM ${RUNTIME_IMAGE}
|
||||
|
||||
ARG GIT_REV=unknown
|
||||
LABEL org.opencontainers.image.title="rpki-explorer" \
|
||||
org.opencontainers.image.revision="${GIT_REV}"
|
||||
|
||||
COPY --from=rust-builder /usr/local/bin/rpki_query_service /usr/local/bin/rpki_query_service
|
||||
COPY --from=rust-builder /usr/local/bin/rpki_query_indexer /usr/local/bin/rpki_query_indexer
|
||||
COPY --from=ui-builder /ui/dist /usr/share/nginx/html
|
||||
COPY deploy/rpki-explorer/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY deploy/rpki-explorer/entrypoint.sh /entrypoint.sh
|
||||
|
||||
RUN chmod +x /entrypoint.sh && mkdir -p /data
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user