Files
thebet365/docker/admin/Dockerfile
Mars d5913b6301 fix(deploy): use ASCII player assets and harden Docker Linux builds
Rename Chinese public paths and image filenames so Vite builds succeed on Linux, strip legacy public dirs in Dockerfiles, and document clean redeploy steps.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 17:28:15 +08:00

32 lines
1.3 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM node:22-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable && corepack prepare pnpm@11.5.2 --activate
FROM base AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/api/package.json apps/api/
COPY apps/player/package.json apps/player/
COPY apps/admin/package.json apps/admin/
COPY packages/shared/package.json packages/shared/
RUN pnpm install --frozen-lockfile
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/apps/api/node_modules ./apps/api/node_modules
COPY --from=deps /app/apps/player/node_modules ./apps/player/node_modules
COPY --from=deps /app/apps/admin/node_modules ./apps/admin/node_modules
COPY --from=deps /app/packages/shared/node_modules ./packages/shared/node_modules
COPY . .
RUN find packages/shared/public -mindepth 1 -maxdepth 1 -type d \
! -name flags ! -name players -exec rm -rf {} + 2>/dev/null || true
# Docker 生产构建跳过 vue-tscadmin 本地类型检查未完全通过vite build 可正常产出)
RUN pnpm --filter @thebet365/admin exec vite build
FROM nginx:1.27-alpine
COPY docker/nginx/admin.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/apps/admin/dist /usr/share/nginx/html
EXPOSE 80