-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (31 loc) · 1.37 KB
/
Copy pathDockerfile
File metadata and controls
33 lines (31 loc) · 1.37 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
# Local Bench (ci-local-bench) — CI marketplace container.
# Deno HTTP server (server.ts, compiled via tsc for the CommonJS/node:sqlite
# entrypoint) that serves index.html + the /api benchmark endpoints from cwd.
# Published as ghcr.io/companionintelligence/ci-local-bench.
#
# Migrated from a node:20-bookworm-slim image to Deno: the app's only native
# addon (better-sqlite3) doesn't load under Deno's N-API compat layer, so
# database.ts now uses the built-in `node:sqlite` module instead — no native
# compilation (python3/make/g++) needed anymore. `deno run` is used (not
# `deno compile`), matching how this container was already deployed.
# ---- build stage ----
FROM denoland/deno:2.9.5 AS build
WORKDIR /app
COPY deno.json deno.lock package.json package-lock.json tsconfig.json ./
COPY src ./src
RUN deno task build
# ---- runtime stage ----
FROM denoland/deno:2.9.5
WORKDIR /app
ENV PORT=3000
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/deno.json ./deno.json
COPY --from=build /app/deno.lock ./deno.lock
COPY --from=build /app/package.json ./package.json
COPY index.html ./index.html
COPY assets ./assets
EXPOSE 3000
# --cached-only makes the container fail fast at startup instead of quietly
# hitting the npm registry if node_modules and deno.lock ever drift apart.
CMD ["run", "-A", "--cached-only", "dist/server.js"]