Skip to content

Commit 8d25ffa

Browse files
fix: remove api/ path prefix in Dockerfile to match ./api build context
All COPY instructions used api/-prefixed paths (e.g. api/src, api/package.json) but the build context is ./api, so Docker resolved them as /api/api/*. Stripped the prefix so paths are relative to the context root. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent aa96afd commit 8d25ffa

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

api/Dockerfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
# Build context: monorepo root (bun.lock lives there, not in api/).
2-
# docker build -f api/Dockerfile .
1+
# Build context: ./api
2+
# docker build -f api/Dockerfile ./api
33

44
# ─── Stage 1: install dependencies ───────────────────────────────────────────
55
FROM oven/bun:1.2-alpine AS deps
66
WORKDIR /app
77

8-
# Install only the API's own production dependencies.
9-
# We don't use workspace mode here — the monorepo root package.json declares
10-
# a "frontend" workspace that doesn't exist in this build context, which
11-
# causes bun install to fail. Installing from api/package.json directly is
12-
# simpler and correct for a single-service Docker image.
13-
COPY api/package.json ./
8+
COPY package.json ./
149
RUN bun install --production
1510

1611
# ─── Stage 2: production image ────────────────────────────────────────────────
@@ -22,8 +17,8 @@ ENV NODE_ENV=production
2217
COPY --from=deps /app/node_modules ./node_modules
2318

2419
# Copy API source only — no tests, seeds, or dev tooling.
25-
COPY api/src ./src
26-
COPY api/package.json api/tsconfig.json ./
20+
COPY src ./src
21+
COPY package.json tsconfig.json ./
2722

2823
EXPOSE 3001
2924

0 commit comments

Comments
 (0)