-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (42 loc) · 1.58 KB
/
Dockerfile
File metadata and controls
51 lines (42 loc) · 1.58 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
# syntax=docker/dockerfile:1.7
# ==========================================================
# 🧱 Base: Bun 環境
# ==========================================================
FROM oven/bun:latest AS base
WORKDIR /app
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1
# ==========================================================
# 📦 Dependencies: パッケージインストール専用
# ==========================================================
FROM base AS deps
WORKDIR /app
# package-lock.json may not exist in this repo; copy only package.json
COPY frontend/package.json ./
# Use Bun to install dependencies from package.json
RUN bun install
# ==========================================================
# 🏗️ Build: Next.js プロジェクトをビルド
# ==========================================================
FROM deps AS builder
WORKDIR /app
ENV NODE_ENV=production
COPY frontend/ ./
COPY data ./data
# Next.js ビルド
# bun prune is not supported in current Bun; run the build only. Dependencies are installed in deps stage
RUN bun run build
# ==========================================================
# 🚀 Runtime: 実行ステージ(最小構成)
# ==========================================================
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1
# 生成物と必要ファイルのみコピー
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/data ./data
EXPOSE 3000
CMD ["bun", "run", "start"]