Files
harbor-web/Dockerfile
yuetsh 5069617b33 项目改名 harbor → lab,前端构建移入 Docker
- 品牌名 港湾 → Lab,favicon harbor.svg → lab.svg
- 新增多阶段 Dockerfile:bun 装依赖并构建,产物直接进 caddy:alpine 镜像,
  部署不再需要宿主机预先 build
- builder 阶段装 nodejs:vue-tsc 在 bun 运行时下无法解析 .vue 模块(TS2307)
- typescript 锁回 ^6.0.3:工作区里未提交的 ^7.0.2 是原生 Go 编译器,
  不再导出 typescript/lib/tsc,vue-tsc@3.3.11 无法运行
- 一并提交此前未提交的 npm → bun 迁移(bun.lock / bunfig.toml,删除 package-lock.json)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 00:49:00 -06:00

21 lines
512 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 构建阶段:编译 Vue 前端
FROM oven/bun:1-alpine AS builder
WORKDIR /app
# vue-tsc 需要在 Node 下运行才能解析 .vue 模块bun 运行时会报 TS2307
RUN apk add --no-cache nodejs
# 先复制依赖清单,让依赖层可以命中缓存
COPY package.json bun.lock bunfig.toml ./
RUN bun install --frozen-lockfile
# 复制源码并构建到 dist/
COPY . .
RUN bun run build
# 运行阶段Caddy 直接托管构建产物
FROM caddy:alpine
COPY --from=builder /app/dist /usr/share/caddy