dockerfile,nodejs version bump

This commit is contained in:
2026-06-15 11:25:44 +08:00
parent cfb75c30cf
commit 3d831650b7
2 changed files with 33 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -euo pipefail
# Format staged Go files.
STAGED_GO=$(git diff --cached --name-only --diff-filter=ACM | grep '\.go$' || true)
if [ -n "$STAGED_GO" ]; then
echo "$STAGED_GO" | while IFS= read -r f; do
gofmt -w "$f"
git add "$f"
done
fi
# Lint and format staged web source files. Paths are repo-root relative; we
# strip the leading "web/" so tooling runs inside the web workspace.
cd web
STAGED_WEB_SRC=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^web/src/.*\.(ts|tsx|vue|js|jsx|mjs)$' || true)
if [ -n "$STAGED_WEB_SRC" ]; then
echo "$STAGED_WEB_SRC" | sed 's|^web/||' | while IFS= read -r f; do
pnpm exec eslint --fix "$f"
pnpm exec prettier --write "$f"
git add "../web/$f"
done
fi
STAGED_WEB_FMT=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^web/.*\.(css|scss|json|md|yaml|yml)$' || true)
if [ -n "$STAGED_WEB_FMT" ]; then
echo "$STAGED_WEB_FMT" | sed 's|^web/||' | while IFS= read -r f; do
pnpm exec prettier --write "$f"
git add "../web/$f"
done
fi
+1 -1
View File
@@ -22,7 +22,7 @@ COPY --from=web /web/dist/. ./cmd/server/web/dist/
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags='-s -w' -o /out/server ./cmd/server RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags='-s -w' -o /out/server ./cmd/server
# ─── Stage 3: runtime ─── # ─── Stage 3: runtime ───
FROM registry.jerryyan.top/library/alpine:3.20 FROM registry.jerryyan.top/library/alpine:3.24
# nodejs/npm 供安装 ACP agent CLI(claude-code-acp / codex / gemini-cli 等, # nodejs/npm 供安装 ACP agent CLI(claude-code-acp / codex / gemini-cli 等,
# 均为 npm 包)。npm 全局 prefix 指到 /data/npm-global(持久卷),容器内 # 均为 npm 包)。npm 全局 prefix 指到 /data/npm-global(持久卷),容器内
# `npm i -g xxx` 一次安装,重建镜像后无需重装;binary_path 填 # `npm i -g xxx` 一次安装,重建镜像后无需重装;binary_path 填