19 lines
583 B
Docker
19 lines
583 B
Docker
FROM node:18-alpine3.18 as build
|
|
|
|
WORKDIR /app
|
|
COPY . .
|
|
|
|
RUN npm install -g pnpm --registry=https://registry.npmmirror.com
|
|
RUN pnpm config set registry https://registry.npmmirror.com
|
|
# canvas 原生模块:预编译包/headers 走 npmmirror 镜像(GitHub 与 nodejs.org 直连 404/被墙)
|
|
ENV canvas_binary_host_mirror=https://registry.npmmirror.com/-/binary/canvas/
|
|
ENV npm_config_disturl=https://registry.npmmirror.com/-/binary/node/
|
|
RUN pnpm install
|
|
|
|
RUN ["pnpm", "build"]
|
|
|
|
FROM nginx:1.25.3
|
|
COPY --from=0 /app/dist /usr/share/nginx/html/
|
|
COPY nginx.conf /etc/nginx/conf.d/
|
|
|