-
Notifications
You must be signed in to change notification settings - Fork 137
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (37 loc) · 1.15 KB
/
Dockerfile
File metadata and controls
47 lines (37 loc) · 1.15 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
FROM node:20-alpine AS base
RUN corepack enable && corepack prepare pnpm@latest --activate
# --- Dependencies ---
FROM base AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# --- Build ---
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN pnpm build
# --- Production ---
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# Install Chromium, dependencies, and CJK fonts for PDF export
RUN apk add --no-cache chromium nss freetype harfbuzz ca-certificates ttf-freefont \
font-noto-cjk
# Tell puppeteer / generate-pdf to use the system Chromium
ENV CHROME_PATH=/usr/bin/chromium-browser
# Copy build output and necessary files
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
# Drizzle migration files (for auto-migration on startup)
COPY --from=builder /app/drizzle ./drizzle
# Data directory for SQLite
RUN mkdir -p /app/data
VOLUME /app/data
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]