@bete/shared emits dist/ artifact; imports resolve via package.json "main"/"exports" pointing to dist/. Both services need the shared package built before `tsc` sees it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
36 lines
678 B
Docker
36 lines
678 B
Docker
FROM node:22-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Install pnpm
|
|
RUN npm install -g pnpm
|
|
|
|
# Copy workspace files
|
|
COPY pnpm-workspace.yaml .
|
|
COPY pnpm-lock.yaml .
|
|
COPY package.json .
|
|
|
|
# Copy packages (workspace dependencies)
|
|
COPY packages/shared ./packages/shared
|
|
|
|
# Copy patches (pnpm patchedDependencies)
|
|
COPY patches ./patches
|
|
|
|
# Copy service
|
|
COPY services/backend ./services/backend
|
|
|
|
# Install dependencies
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# Build shared workspace dependency first
|
|
RUN pnpm --filter './packages/shared' run build
|
|
|
|
# Build backend
|
|
RUN pnpm --filter './services/backend' run build
|
|
|
|
# Expose port
|
|
EXPOSE 3001
|
|
|
|
# Start backend
|
|
CMD ["node", "services/backend/dist/index.js"]
|