-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (28 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
35 lines (28 loc) · 1.07 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
# ── Stage 1: Install dependencies ────────────────
FROM oven/bun:1-slim AS deps
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
# ── Stage 2: Build Astro (server mode) ──────────
FROM oven/bun:1-slim AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN bun run build
# ── Stage 3: Production deps only ────────────────
FROM oven/bun:1-slim AS prod-deps
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile --production
# ── Stage 4: Production runtime ─────────────────
FROM node:22-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends socat \
&& rm -rf /var/lib/apt/lists/*
# Only production node_modules (no devDeps)
COPY --from=prod-deps /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY scripts/start-web ./scripts/start-web
RUN chmod +x scripts/start-web
ENV NODE_ENV=production
CMD ["./scripts/start-web"]