-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (54 loc) · 2.24 KB
/
Copy pathDockerfile
File metadata and controls
67 lines (54 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# ============================================
# Stage 1: Dependencies
# ============================================
FROM --platform=linux/amd64 oven/bun:1.3-debian AS deps
WORKDIR /app
# Copy package files for all workspaces
COPY package.json bun.lock turbo.json ./
COPY packages/fs/package.json ./packages/fs/
COPY packages/sql/package.json ./packages/sql/
COPY packages/fetch/package.json ./packages/fetch/
COPY packages/env/package.json ./packages/env/
COPY packages/auth/package.json ./packages/auth/
COPY packages/form/package.json ./packages/form/
COPY packages/crypto/package.json ./packages/crypto/
COPY packages/ai/package.json ./packages/ai/
COPY packages/qr/package.json ./packages/qr/
COPY apps/landing/package.json ./apps/landing/
RUN bun install --frozen-lockfile
# ============================================
# Stage 2: Build
# ============================================
FROM --platform=linux/amd64 oven/bun:1.3-debian AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Build all packages + landing app (standalone mode)
RUN bun run build
# ============================================
# Stage 3: Production Runtime
# ============================================
FROM --platform=linux/amd64 oven/bun:1.3-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
# Copy standalone Next.js build
COPY --from=builder /app/apps/landing/.next/standalone ./
COPY --from=builder /app/apps/landing/.next/static ./apps/landing/.next/static
COPY --from=builder /app/apps/landing/public ./apps/landing/public
# Copy full repo for FS package access (excluding node_modules, .next, dbs)
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/apps/landing/app ./apps/landing/app
COPY --from=builder /app/apps/landing/components ./apps/landing/components
COPY --from=builder /app/apps/landing/lib ./apps/landing/lib
COPY --from=builder /app/apps/landing/*.ts ./apps/landing/
COPY --from=builder /app/apps/landing/*.json ./apps/landing/
COPY --from=builder /app/README.md ./
COPY --from=builder /app/package.json ./
# Copy seed script
COPY --from=builder /app/apps/landing/seed.ts ./apps/landing/
# Entrypoint script
COPY docker-entrypoint.sh ./
RUN chmod +x docker-entrypoint.sh
EXPOSE 3000
CMD ["./docker-entrypoint.sh"]