From e7aa866332366d57b2ef96ba41928b4f140fba52 Mon Sep 17 00:00:00 2001 From: Robin Choice Date: Sun, 12 Apr 2026 20:09:08 +0200 Subject: [PATCH] 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) --- Dockerfile.api | 8 +++++--- Dockerfile.web | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile.api b/Dockerfile.api index 1669f28..6e070cb 100644 --- a/Dockerfile.api +++ b/Dockerfile.api @@ -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"] diff --git a/Dockerfile.web b/Dockerfile.web index ade6673..052f9c3 100644 --- a/Dockerfile.web +++ b/Dockerfile.web @@ -2,23 +2,28 @@ 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/ COPY apps/web/package.json ./apps/web/ RUN bun install --frozen-lockfile FROM base AS build COPY --from=install /app/node_modules ./node_modules COPY --from=install /app/packages/shared/node_modules ./packages/shared/node_modules +COPY --from=install /app/packages/db/node_modules ./packages/db/node_modules COPY --from=install /app/apps/web/node_modules ./apps/web/node_modules COPY . . RUN cd apps/web && bun run build FROM base AS production +RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/* COPY --from=build /app/apps/web/build ./build COPY --from=build /app/apps/web/package.json . COPY --from=build /app/node_modules ./node_modules EXPOSE 3000 ENV NODE_ENV=production ENV PORT=3000 +HEALTHCHECK --interval=10s --timeout=5s --retries=5 CMD curl -f http://localhost:3000/ || exit 1 CMD ["bun", "./build/index.js"]