frontend/Dockerfile
timerzz d1275c3ce1
Some checks failed
Build image / build (push) Failing after 4s
feat 访问产品历史价格时进行url编码
2024-06-04 20:04:56 +08:00

15 lines
428 B
Docker

FROM node:20-slim AS front
COPY . /build
WORKDIR /build/
RUN npm config set registry http://registry.npmmirror.com && npm install -g pnpm
RUN pnpm install && pnpm run build
FROM nginx:alpine
COPY --from=front /build/dist /usr/share/dist
RUN rm /etc/nginx/conf.d/default.conf
# 将自定义配置文件nginx.conf复制到容器内/etc/nginx/conf.d/目录
ADD ./nginx.conf /etc/nginx/conf.d/
CMD ["nginx", "-g", "daemon off;"]