mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-29 07:56:37 +08:00
f307e7d5eb
pnpm config set doesn't support onlyBuiltDependencies in global config. Use .npmrc file instead.
21 lines
466 B
Docker
21 lines
466 B
Docker
# 多阶段构建 - 构建阶段
|
|
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json pnpm-lock.yaml* ./
|
|
RUN echo 'onlyBuiltDependencies[]=@tailwindcss/oxide' > .npmrc && corepack enable pnpm && pnpm install --frozen-lockfile
|
|
|
|
COPY . .
|
|
RUN pnpm run build
|
|
|
|
# 生产阶段
|
|
FROM nginx:stable-alpine AS production-stage
|
|
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"] |