Files

26 lines
824 B
Docker
Raw Permalink Normal View History

# Build stage
FROM oven/bun:1.3 AS builder
WORKDIR /app
# Copy workspace manifests + lockfile
COPY package.json bunfig.toml bun.lock ./
COPY apps/web/package.json apps/web/package.json
COPY apps/api/package.json apps/api/package.json
COPY apps/worker/package.json apps/worker/package.json
COPY packages/db/package.json packages/db/package.json
COPY packages/shared/package.json packages/shared/package.json
# Install dependencies (workspace-aware)
RUN bun install --frozen-lockfile 2>/dev/null || bun install
# Copy full web app source (exclude node_modules to avoid BuildKit cache mount conflict)
COPY --exclude=node_modules apps/web ./apps/web
# Build the SPA
RUN cd apps/web && bun run build
# Serve stage
FROM caddy:alpine
COPY --from=builder /app/apps/web/dist /usr/share/caddy
COPY Caddyfile /etc/caddy/Caddyfile