feat: Docker 镜像构建成功 — 17.7MB alpine 镜像
- .dockerignore: 排除 target/ gui/ test/ (镜像上下文 ~3KB) - web/Dockerfile: sed 移除 gui 成员后编译,避免 Tauri 依赖 - 多阶段构建: rust:alpine 编译 → alpine:3.22 运行 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
target/
|
||||||
|
gui/
|
||||||
|
test/
|
||||||
|
*.png
|
||||||
|
*.svg
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
@@ -4,6 +4,8 @@ FROM rust:1.95-alpine AS builder
|
|||||||
RUN apk add --no-cache musl-dev
|
RUN apk add --no-cache musl-dev
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
# 移除 gui 成员(不需要 Tauri/WebView2 依赖)
|
||||||
|
RUN sed -i 's/"core", "cli", "gui", "web"/"core", "cli", "web"/' Cargo.toml
|
||||||
RUN cargo build --release -p qrgen-web
|
RUN cargo build --release -p qrgen-web
|
||||||
|
|
||||||
# ── 运行阶段 ──
|
# ── 运行阶段 ──
|
||||||
|
|||||||
Reference in New Issue
Block a user