diff --git a/docker/.dockerignore b/docker/.dockerignore index 60138fc..4db28d5 100644 --- a/docker/.dockerignore +++ b/docker/.dockerignore @@ -1,6 +1,8 @@ -# Dependencies - exclude node_modules from being copied +# Dependencies - MUST exclude these node_modules **/node_modules +.pnp +.pnp.js # Turbo .turbo @@ -9,6 +11,7 @@ node_modules # Next.js build artifacts .next **/.next +out **/out # Development @@ -19,7 +22,6 @@ node_modules .env*.local .vscode .idea -.cache # Tests **/__tests__ @@ -28,7 +30,9 @@ node_modules **/*.spec.ts # Build artifacts +dist **/dist +build **/build # Convex local @@ -37,3 +41,8 @@ packages/backend/.convex # OS .DS_Store Thumbs.db + +# Docker +docker +Dockerfile +.dockerignore diff --git a/docker/Dockerfile b/docker/Dockerfile index a24ece2..82d2d3e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,20 +1,20 @@ # syntax=docker/dockerfile:1 FROM oven/bun:alpine AS base -# Builder stage - do everything here +# Builder stage FROM base AS builder RUN apk add --no-cache libc6-compat WORKDIR /app -# Copy all source code first +# Copy source code (node_modules excluded via .dockerignore) COPY . . -# Install dependencies (this will create proper workspace structure) +# Install all dependencies RUN bun install -# Build the Next.js app +# Build with proper environment ENV NEXT_TELEMETRY_DISABLED=1 -ENV SKIP_ENV_VALIDATION=1 +ENV NODE_ENV=production RUN bun run build --filter=@gib/next # Runner stage