refactor(deploy): consolidate configuration and reorganize docker files

This commit is contained in:
zenhouke
2026-02-12 02:16:41 +08:00
parent 4de579b57b
commit 057e95cb9a
9 changed files with 64 additions and 89 deletions
+33
View File
@@ -0,0 +1,33 @@
FROM node:25-alpine AS builder
WORKDIR /build
RUN npm install -g pnpm@10
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
COPY packages ./packages
RUN pnpm install
ARG VITE_API_URL=http://localhost:8080
ARG VITE_AGENT_URL=http://localhost:8081
ENV VITE_API_URL=$VITE_API_URL
ENV VITE_AGENT_URL=$VITE_AGENT_URL
WORKDIR /build/packages/web
RUN pnpm build
FROM nginx:alpine
COPY --from=builder /build/packages/web/dist /usr/share/nginx/html
COPY docker/config/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
CMD ["nginx", "-g", "daemon off;"]