Open History to see the last commit
1# Build from the repository root:
2#
3# docker build -f packages/tools/eventlog-server/Dockerfile .
4
5# The bundle is plain JavaScript, so build it on the native platform and only
6# copy it into the target platform's image.
7FROM --platform=$BUILDPLATFORM node:26-slim AS build
8# Install and bundle inside a writable mount of the build context, so only the
9# bundle ends up in a layer.
10RUN --mount=type=bind,target=/repo,rw \
11 --mount=type=cache,target=/root/.local/share/pnpm/store \
12 cd /repo \
13 && npm install -g "pnpm@$(node -p "require('./package.json').packageManager.split('@')[1]")" \
14 && pnpm install --frozen-lockfile --ignore-scripts --filter "@effect/eventlog-server..." \
15 && pnpm --filter @effect/eventlog-server bundle \
16 && mkdir /out /data \
17 && cp packages/tools/eventlog-server/build/main.js /out/main.js
18
19FROM node:26-slim
20WORKDIR /app
21COPY --from=build /out/main.js ./main.js
22COPY --from=build --chown=node:node /data /data
23ENV NODE_ENV=production
24ENV PORT=8080
25ENV DATABASE_PATH=/data/eventlog.db
26VOLUME /data
27EXPOSE 8080
28USER node
29HEALTHCHECK CMD ["node", "-e", "fetch(`http://localhost:${process.env.PORT}/health`).then((r) => process.exit(r.ok ? 0 : 1), () => process.exit(1))"]
30CMD ["node", "main.js"]