Files
verdaccio-cache-manager/Dockerfile
T

24 lines
628 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,镜像内无需 pnpm/corepack/构建工具链
FROM --platform=linux/amd64 node:18-slim
ENV NODE_ENV=production \
PORT=3000 \
DATA_DIR=/app/data \
npm_config_registry=https://registry.npmmirror.com
WORKDIR /app
# 后端依赖:仅 express + better-sqlite3(node:18 有预编译二进制)
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"]