-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (39 loc) · 1.41 KB
/
Copy pathDockerfile
File metadata and controls
55 lines (39 loc) · 1.41 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
55
# syntax=docker/dockerfile:1
ARG BUN_VERSION=1.3.14
# Base stage with pinned Bun (matches mise.toml)
FROM node:22-slim AS bun-base
ARG BUN_VERSION
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates unzip && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"
ENV PATH="/root/.bun/bin:${PATH}"
WORKDIR /app
# Stage 1: Build the grapity package
FROM bun-base AS builder
COPY package.json bun.lock* ./
RUN bun install --frozen-lockfile
COPY . .
RUN bun run build
# Stage 2: Production dependencies only
FROM bun-base AS prod-deps
COPY package.json bun.lock* ./
RUN bun install --frozen-lockfile --production
# Stage 3: Runtime image
FROM node:22-slim AS runtime
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && rm -rf /var/lib/apt/lists/*
# Create data directory for SQLite volume (used when GRAPITY_DATABASE_URL is a file path)
RUN mkdir -p /data
# Copy production artifacts
COPY --from=builder /app/package.json ./
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/drizzle/migrations ./drizzle/migrations
COPY --from=prod-deps /app/node_modules ./node_modules
ENV HOME=/root
ENV NODE_ENV=production
# hub port
EXPOSE 3000
# registry port
EXPOSE 3750
# Selects which service to run: registry (default) or hub
ENV GRAPITY_SERVICE=registry
ENTRYPOINT ["node", "dist/serve/entrypoint.js"]