Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (37 loc) · 1.65 KB
/
Copy pathDockerfile
File metadata and controls
41 lines (37 loc) · 1.65 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
# HQTUI marketing site — one Railway service, built from the monorepo root.
FROM oven/bun:1.4 AS base
WORKDIR /app
# --- dependencies -----------------------------------------------------------
FROM base AS deps
COPY package.json bun.lock* bunfig.toml ./
COPY packages/hqtui/package.json packages/hqtui/
COPY apps/web/package.json apps/web/
COPY apps/demo/package.json apps/demo/
COPY apps/benchmark/package.json apps/benchmark/
COPY examples/package.json examples/
RUN bun install --frozen-lockfile
# --- build ------------------------------------------------------------------
FROM base AS builder
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules
COPY . .
# The site imports the library from source-built dist, so build it first.
RUN cd packages/hqtui && bun x tsc -p tsconfig.build.json
ENV NEXT_TELEMETRY_DISABLED=1
RUN cd apps/web && bun run build
# --- runtime ----------------------------------------------------------------
FROM base AS runner
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV PORT=3000
# Railway injects HOSTNAME as the container id; Next's standalone server binds
# to it literally and then answers nothing. It must listen on all interfaces.
ENV HOSTNAME=0.0.0.0
# The oven/bun image is Debian-slim and already ships a non-root `bun` user,
# so there is no adduser to call and no user to create.
COPY --from=builder --chown=bun:bun /app/apps/web/.next/standalone ./
COPY --from=builder --chown=bun:bun /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=builder --chown=bun:bun /app/apps/web/public ./apps/web/public
USER bun
EXPOSE 3000
CMD ["bun", "apps/web/server.js"]