29 lines
687 B
Docker
29 lines
687 B
Docker
FROM docker-0.unsee.tech/node:16.20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json ./
|
|
|
|
# 安装构建依赖并设置npm镜像
|
|
RUN npm config set registry https://registry.npmmirror.com && \
|
|
npm install
|
|
|
|
|
|
COPY . .
|
|
COPY deploy/nginx/ /app/
|
|
|
|
RUN npm run build:prod
|
|
|
|
FROM docker-0.unsee.tech/nginx:stable-alpine
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache ca-certificates && update-ca-certificates && \
|
|
apk add --update tzdata && \
|
|
rm -rf /var/cache/apk/*
|
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html/jcc-cip
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
|
COPY deploy/nginx/default.conf /etc/nginx/conf.d/default.conf
|
|
ENV TZ=Asia/Shanghai
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"] |