fix: build @bete/shared before frontend in Dockerfile

TypeScript compilation in the frontend Docker build fails with TS2307:
Cannot find module '@bete/shared' because the shared package's .d.ts
files in dist/ were never generated. The backend and discord-gateway
Dockerfiles already have this build step — frontend was missing it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MythEclipse
2026-06-09 20:35:35 +07:00
co-authored by Claude Opus 4.8
parent 07032ab521
commit 655380dd8d
+10 -2
View File
@@ -9,7 +9,7 @@ WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Copy workspace files
# Copy dependency definition files first for caching
COPY pnpm-workspace.yaml .
COPY pnpm-lock.yaml .
COPY package.json .
@@ -17,11 +17,19 @@ COPY package.json .
# Copy patches (pnpm patchedDependencies)
COPY patches ./patches
# Copy workspace dependency
COPY packages/shared ./packages/shared
# Copy service
COPY services/frontend ./services/frontend
# Install dependencies
RUN pnpm install --frozen-lockfile
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile
# Build shared workspace dependency first (required for TypeScript declarations)
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
pnpm --filter './packages/shared' run build
# Build frontend (env vars injected at build time)
RUN VITE_BE_API_URL=${VITE_BE_API_URL} VITE_BE_WS_URL=${VITE_BE_WS_URL} pnpm --filter './services/frontend' run build