-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 977 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (23 loc) · 977 Bytes
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
FROM oven/bun:1 AS bun-runtime
FROM node:22-bookworm-slim AS dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force
FROM node:22-bookworm-slim AS build
WORKDIR /app
COPY --from=bun-runtime /usr/local/bin/bun /usr/local/bin/bun
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json tsup.config.ts ./
COPY src ./src
RUN npm run build:local && npm run build:remote
FROM bun-runtime AS runtime
WORKDIR /app
ENV NODE_ENV=production
COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=build --chown=bun:bun /app/dist ./dist
RUN mkdir -p /data && chown bun:bun /data
EXPOSE 8787
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=5 CMD ["bun", "-e", "fetch('http://127.0.0.1:8787/readyz').then((response) => { if (!response.ok) throw new Error(String(response.status)); }).catch(() => process.exit(1))"]
USER bun
CMD ["bun", "dist/remote/index.js"]