ci/woodpecker/pr/hledger Pipeline was successful
ci/woodpecker/pr/jobs Pipeline was successful
ci/woodpecker/pr/snapshots Pipeline was successful
ci/woodpecker/pr/web Pipeline was successful
ci/woodpecker/pr/worker Pipeline was successful
ci/woodpecker/push/hledger Pipeline was successful
ci/woodpecker/push/jobs Pipeline was successful
ci/woodpecker/push/snapshots Pipeline was successful
ci/woodpecker/push/web Pipeline was successful
ci/woodpecker/push/worker Pipeline was successful
Keep browsing passive and give manual preparation its own page. Remove automatic source reconciliation and freshness machinery, retain complete saved data and native accounting, and organize the remaining app by feature.
46 lines
1.7 KiB
Docker
46 lines
1.7 KiB
Docker
# syntax=docker/dockerfile:1
|
|
# Match When's Alpine runtime. The pinned upstream hledger binary is static.
|
|
FROM node:26.5.0-alpine AS runtime
|
|
|
|
FROM runtime AS native
|
|
ARG TARGETARCH
|
|
RUN test "$TARGETARCH" = amd64 || (echo 'hledger 1.99.5 images currently require linux/amd64.' >&2; exit 1)
|
|
RUN apk add --no-cache curl
|
|
COPY tools/install-hledger.sh /tmp/install-hledger.sh
|
|
RUN sh /tmp/install-hledger.sh /usr/local/bin && rm /tmp/install-hledger.sh
|
|
|
|
FROM native AS base
|
|
WORKDIR /m
|
|
ENV CI=true
|
|
RUN npm install --global pnpm@11.9.0 && pnpm config set store-dir /pnpm/store
|
|
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm fetch --store-dir /pnpm/store
|
|
COPY . .
|
|
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm install --frozen-lockfile --offline --store-dir /pnpm/store
|
|
|
|
FROM base AS dev
|
|
RUN mkdir -p /app/data && chown node:node /app/data
|
|
USER node
|
|
ENV HOME=/home/node
|
|
CMD ["pnpm", "--filter", "@hledger-reports/worker", "dev"]
|
|
|
|
FROM base AS checks
|
|
CMD ["sh", "-c", "pnpm check && pnpm lint && pnpm test && pnpm build && pnpm worker:inspect"]
|
|
|
|
FROM base AS builder
|
|
RUN pnpm --filter "@hledger-reports/worker..." build
|
|
|
|
FROM builder AS pruner
|
|
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm --filter @hledger-reports/worker --prod deploy --legacy /pruned
|
|
|
|
FROM runtime AS prod
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
COPY --from=native /usr/local/bin/hledger /usr/local/bin/hledger
|
|
COPY --from=pruner /pruned/dist ./dist
|
|
COPY --from=pruner /pruned/node_modules ./node_modules
|
|
COPY --from=pruner /pruned/package.json ./package.json
|
|
RUN mkdir -p /app/data && chown node:node /app/data
|
|
USER node
|
|
CMD ["node", "dist/src/index.js"]
|