wireguard-dashboard-admin/Dockerfile

22 lines
553 B
Docker
Raw Permalink Normal View History

2024-08-20 10:32:14 +08:00
# 打包前端
FROM node:18-alpine as build-stage
WORKDIR front
COPY . .
WORKDIR web
RUN corepack enable
RUN corepack prepare pnpm@8.6.10 --activate
RUN npm config set registry https://registry.npmmirror.com
RUN pnpm install
RUN pnpm run build
# 前端集成打包
FROM nginx:alpine
WORKDIR /data
# 替换掉Nginx默认配置
2024-08-20 11:14:11 +08:00
RUN rm /etc/nginx/conf.d/default.conf
COPY --from=build-stage /front/docker/web.conf /etc/nginx/conf.d/default.conf
2024-08-20 10:32:14 +08:00
COPY --from=build-stage /front/dist/ ./
# 复制编译后的文件到容器内
RUN /bin/sh -c 'echo init ok'