Files
verdaccio-cache-manager/Dockerfile
T
yinjun.chen1 20de3d350c
CI / Backend tests (push) Canceled after 0s
CI / Frontend build (push) Canceled after 0s
chore: 第六组工程化统一
- Dockerfile: node:18-slim 升级 node:20-slim(LTS,better-sqlite3 有预编译二进制)
- engines 统一 node >=20.19.0(对齐 Vite 8 要求,前后端一致)
- backend 新增 npm test(node --test,自动发现 test/ 目录)
- 新增 .github/workflows/ci.yml:后端 npm test + 前端 build
- 提交 frontend/package-lock.json,CI 依赖缓存生效
2026-09-21 10:04:27 +08:00

24 lines
613 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.
# 本地已构建好 frontend/dist,镜像内无需构建工具链
FROM --platform=linux/amd64 node:20-slim
ENV NODE_ENV=production \
PORT=3000 \
DATA_DIR=/app/data \
npm_config_registry=https://registry.npmmirror.com
WORKDIR /app
# 后端依赖:仅 express + better-sqlite3(node:20 有预编译二进制)
COPY backend/package.json ./
RUN npm install --production
COPY backend/ ./
# 前端产物(本地构建好的 dist)
COPY frontend/dist /frontend/dist
# 非 root 运行
RUN mkdir -p /app/data && chown -R 10000:10000 /app/data
USER 10000:10000
EXPOSE 3000
CMD ["node", "server.js"]