JCC-RIP/Dockerfile

25 lines
708 B
Docker

FROM node:16.20-alpine3.17 AS builder
WORKDIR /app
COPY . .
COPY deploy/nginx/ /app/
RUN npm install --registry=https://registry.npmmirror.com &&\
npm run build:prod
FROM nginx:stable-alpine
WORKDIR /app
#修改alpine源为上海交通大学
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.sjtug.sjtu.edu.cn/g' /etc/apk/repositories && \
apk update && \
apk upgrade && \
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/jcce
RUN rm /etc/nginx/conf.d/default.conf
COPY deploy/nginx/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]