-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (37 loc) · 1.32 KB
/
Copy pathDockerfile
File metadata and controls
54 lines (37 loc) · 1.32 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
# Build stage
FROM oven/bun:1-alpine AS builder
ARG VERSION=1.1.0
WORKDIR /app
# Copy workspace and lockfile
COPY package.json bun.lock ./
# Copy package manifests for all workspaces (needed for bun install)
COPY apps/compooss/package.json ./apps/compooss/
COPY apps/docs/package.json ./apps/docs/
COPY packages/types/package.json ./packages/types/
COPY packages/ui/package.json ./packages/ui/
# Install dependencies
RUN bun install --frozen-lockfile
# Copy full source
COPY . .
# Build the compooss app (turbo builds @compooss/types, @compooss/ui first)
RUN bunx turbo run build --filter=@compooss/app
# Production stage - minimal image with standalone Next.js output
FROM oven/bun:1-alpine AS runner
ARG VERSION=1.1.0
LABEL org.opencontainers.image.version="${VERSION}"
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# Create non-root user
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Copy standalone build output
COPY --from=builder /app/apps/compooss/.next/standalone ./
COPY --from=builder /app/apps/compooss/.next/static ./apps/compooss/.next/static
COPY --from=builder /app/apps/compooss/public ./apps/compooss/public
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
# Standalone server lives at apps/compooss/server.js
CMD ["node", "apps/compooss/server.js"]