Fix Dockerfiles: include all workspace package.jsons for bun lockfile

The monorepo bun.lock references all workspaces. Previous Dockerfiles
only copied a subset, causing frozen-lockfile install to fail. Now all
package.jsons are copied. Also add curl + healthchecks to both images.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Robin Choice
2026-04-12 20:09:08 +02:00
parent 09e47d8800
commit e7aa866332
2 changed files with 11 additions and 4 deletions

View File

@@ -2,11 +2,12 @@ FROM oven/bun:1 AS base
WORKDIR /app
FROM base AS install
COPY package.json bun.lock ./
COPY package.json bun.lock turbo.json ./
COPY packages/shared/package.json ./packages/shared/
COPY packages/db/package.json ./packages/db/
COPY apps/api/package.json ./apps/api/
RUN bun install --frozen-lockfile --production
COPY apps/web/package.json ./apps/web/
RUN bun install --frozen-lockfile
FROM base AS build
COPY --from=install /app/node_modules ./node_modules
@@ -16,8 +17,9 @@ COPY --from=install /app/apps/api/node_modules ./apps/api/node_modules
COPY . .
FROM base AS production
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg curl && rm -rf /var/lib/apt/lists/*
COPY --from=build /app .
EXPOSE 3000
ENV NODE_ENV=production
HEALTHCHECK --interval=10s --timeout=5s --retries=5 CMD curl -f http://localhost:3000/health || exit 1
CMD ["bun", "run", "apps/api/src/index.ts"]