Files
thebet365/docker/player/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

34 lines
1.4 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 . .
# 移除历史中文目录(解压 zip 覆盖部署时可能残留Linux 下会导致 vite publicDir 复制失败)
RUN find packages/shared/public -mindepth 1 -maxdepth 1 -type d \
! -name flags ! -name players -exec rm -rf {} + 2>/dev/null || true
RUN pnpm --filter @thebet365/shared build
# Docker 生产构建仅 vite build避免 CI/Docker 环境与本地 vue-tsc 差异
RUN pnpm --filter @thebet365/player exec vite build
FROM nginx:1.27-alpine
COPY docker/nginx/player.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/apps/player/dist /usr/share/nginx/html
EXPOSE 80