-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (36 loc) · 1.2 KB
/
Dockerfile
File metadata and controls
45 lines (36 loc) · 1.2 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
FROM oven/bun:1 AS base
WORKDIR /app
# Install dependencies (better-sqlite3 needs python3 + build tools)
FROM base AS deps
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
COPY package.json bun.lock* ./
RUN bun install --frozen-lockfile --production --ignore-scripts && \
bunx node-gyp rebuild --release --directory=node_modules/better-sqlite3
# Build docs site (Astro + Starlight)
FROM base AS docs
WORKDIR /app/docs/site
COPY docs/site/package.json docs/site/bun.lock* ./
RUN bun install --frozen-lockfile
COPY docs/site/ ./
# AvailableFontsTable.tsx imports from ../../../../src/engine/font-catalog
COPY src/engine /app/src/engine
RUN bun run build
# Runner stage — no build tools needed
FROM base AS runner
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY package.json ./
COPY tsconfig.json ./
COPY src/ ./src/
COPY scripts/ ./scripts/
RUN bun run scripts/download-fonts.ts
# Copy Astro build output
COPY --from=docs /app/docs/site/dist ./docs-dist
# Create data directory for SQLite
RUN mkdir -p /data
ENV NODE_ENV=production
ENV PORT=3000
ENV DATABASE_URL=file:/data/og-engine.db
ENV AUTH_ENABLED=true
EXPOSE 3000
CMD ["bun", "run", "src/index.ts"]