feat(deploy): add containerized deployment configuration and scripts
- Add Dockerfile for frontend and server services - Add Docker Compose configs (standard and offline mode) - Add nginx.conf for admin-web service - Add deploy scripts: package.sh (packaging) and load-and-start.sh (startup) - Add deploy/config.yaml, .env.example, and prompts.yml configurations - Add image management design specification doc
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Build context: repo root (monorepo)
|
||||
|
||||
# ─── Stage 1: Build Vue app ────────────────────────────────────────────────────
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
RUN npm install -g pnpm@9
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy workspace manifests first (cache-friendly)
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY packages/shared-types/package.json ./packages/shared-types/
|
||||
COPY packages/http-client/package.json ./packages/http-client/
|
||||
COPY apps/admin-web/package.json ./apps/admin-web/
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Copy source
|
||||
COPY packages/ ./packages/
|
||||
COPY apps/admin-web/ ./apps/admin-web/
|
||||
|
||||
# Build
|
||||
ARG VITE_API_BASE_URL=/api
|
||||
RUN pnpm --filter admin-web build
|
||||
|
||||
# ─── Stage 2: Serve with nginx ─────────────────────────────────────────────────
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
COPY --from=builder /app/apps/admin-web/dist /usr/share/nginx/html
|
||||
COPY apps/admin-web/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
Reference in New Issue
Block a user