react-leaflet v5 requires React 19 — caused "render2 is not a function" runtime crash and white screen. Downgraded to v4.2.1. fix(docker): separate DB volume mount from API dist directory Volume was mounted at /app/apps/api, overwriting compiled dist/ with stale files from previous container runs. Changed mount to /app/data for DB only. fix(api): copy area.json and vessel1.json into API Docker image Seed files could not resolve JSON data at container startup. Added COPY in Dockerfile and corrected path depth from 5 to 4 levels. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
965 B
Docker
29 lines
965 B
Docker
FROM node:20-alpine AS base
|
|
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
|
|
|
|
FROM base AS deps
|
|
WORKDIR /app
|
|
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
|
|
COPY packages/types/package.json ./packages/types/
|
|
COPY apps/api/package.json ./apps/api/
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
FROM deps AS builder
|
|
COPY packages/types/ ./packages/types/
|
|
COPY apps/api/ ./apps/api/
|
|
RUN pnpm --filter @ymir/types build
|
|
RUN pnpm --filter @ymir/api build
|
|
|
|
FROM node:20-alpine AS runner
|
|
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
|
|
WORKDIR /app
|
|
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
|
|
COPY packages/types/package.json ./packages/types/
|
|
COPY apps/api/package.json ./apps/api/
|
|
RUN pnpm install --frozen-lockfile --prod
|
|
COPY --from=builder /app/packages/types/dist/ ./packages/types/dist/
|
|
COPY --from=builder /app/apps/api/dist/ ./apps/api/dist/
|
|
COPY area.json vessel1.json ./
|
|
EXPOSE 3000
|
|
CMD ["node", "apps/api/dist/index.js"]
|