Files
cvfs/docker/webapp.Dockerfile
Claude f3d1ddad5d Fix API URL config: use Next.js rewrite proxy instead of NEXT_PUBLIC_*
NEXT_PUBLIC_* is baked at build time so runtime docker-compose environment
vars have no effect. Instead:
- next.config.ts rewrites /api/* -> API_BASE_URL/api/* at the server level
- api.ts uses relative paths (no env var in client bundle at all)
- docker-compose passes API_BASE_URL=http://cvfs-backend:8080 at runtime
- Dockerfile no longer needs any build args

Requests: browser -> Next.js server (/api/*) -> cvfs-backend:8080 (/api/*)

https://claude.ai/code/session_01Xmxm2QLgFBgRJyYD6VukR6
2026-04-02 18:23:58 +00:00

28 lines
655 B
Docker

# syntax=docker/dockerfile:1.6
FROM oven/bun:1.2 AS base
WORKDIR /app
FROM base AS deps
COPY apps/webapp/package.json apps/webapp/bun.lock ./
RUN bun install --frozen-lockfile
FROM deps AS builder
COPY apps/webapp ./
RUN bun run build
FROM oven/bun:1.2-slim AS runner
WORKDIR /app
ENV NODE_ENV=production \
PORT=3000
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/bun.lock ./bun.lock
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/next.config.ts ./next.config.ts
EXPOSE 3000
CMD ["bun", "run", "start"]