JCC-RIP/Dockerfile

23 lines
674 B
Docker
Raw Permalink Normal View History

2023-11-15 17:00:05 +08:00
FROM node:16.20-alpine3.17 AS builder
WORKDIR /app
COPY . .
COPY deploy/nginx/ /app/
RUN npm install --registry=https://registry.npmmirror.com &&\
2024-05-16 08:40:44 +08:00
npm run build:prod
2023-11-15 17:00:05 +08:00
2023-03-24 09:05:45 +08:00
FROM nginx:stable-alpine
2023-11-15 17:00:05 +08:00
WORKDIR /app
#修改alpine源为上海交通大学
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.sjtug.sjtu.edu.cn/g' /etc/apk/repositories && \
apk add --no-cache ca-certificates && update-ca-certificates && \
apk add --update tzdata && \
rm -rf /var/cache/apk/*
2024-03-04 09:43:31 +08:00
COPY --from=builder /app/dist /usr/share/nginx/html/jcc-rip
2023-03-24 09:05:45 +08:00
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;"]