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:
co-authored by
Claude Opus 4.8
parent
07032ab521
commit
655380dd8d
@@ -9,7 +9,7 @@ WORKDIR /app
|
|||||||
# Install pnpm
|
# Install pnpm
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
# Copy workspace files
|
# Copy dependency definition files first for caching
|
||||||
COPY pnpm-workspace.yaml .
|
COPY pnpm-workspace.yaml .
|
||||||
COPY pnpm-lock.yaml .
|
COPY pnpm-lock.yaml .
|
||||||
COPY package.json .
|
COPY package.json .
|
||||||
@@ -17,11 +17,19 @@ COPY package.json .
|
|||||||
# Copy patches (pnpm patchedDependencies)
|
# Copy patches (pnpm patchedDependencies)
|
||||||
COPY patches ./patches
|
COPY patches ./patches
|
||||||
|
|
||||||
|
# Copy workspace dependency
|
||||||
|
COPY packages/shared ./packages/shared
|
||||||
|
|
||||||
# Copy service
|
# Copy service
|
||||||
COPY services/frontend ./services/frontend
|
COPY services/frontend ./services/frontend
|
||||||
|
|
||||||
# Install dependencies
|
# 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)
|
# 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
|
RUN VITE_BE_API_URL=${VITE_BE_API_URL} VITE_BE_WS_URL=${VITE_BE_WS_URL} pnpm --filter './services/frontend' run build
|
||||||
|
|||||||
Reference in New Issue
Block a user