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:
2026-06-18 12:23:28 +08:00
parent dcd53b2691
commit f19bd6e52e
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
target/
gui/
test/
*.png
*.svg
.git/
.gitignore
+2
View File
@@ -4,6 +4,8 @@ FROM rust:1.95-alpine AS builder
RUN apk add --no-cache musl-dev
WORKDIR /app
COPY . .
# 移除 gui 成员(不需要 Tauri/WebView2 依赖)
RUN sed -i 's/"core", "cli", "gui", "web"/"core", "cli", "web"/' Cargo.toml
RUN cargo build --release -p qrgen-web
# ── 运行阶段 ──