frontend/Dockerfile
timerzz 43e2dff6a3
Some checks failed
Build image / build (push) Failing after 17s
feat 从之前的服务中将前端分离
2024-05-12 15:53:54 +08:00

13 lines
354 B
Docker

FROM oven/bun:1 as front
COPY . /build
WORKDIR /build/wwwroot
RUN bun install && bun run build
FROM nginx:alpine
COPY --from=front /build/wwwroot/dist /usr/share/
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;"]