-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (24 loc) · 1.46 KB
/
Copy pathDockerfile
File metadata and controls
27 lines (24 loc) · 1.46 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
FROM node:25.9.0
RUN mkdir /XChainDecoder/
COPY ./package.json /XChainDecoder/package.json
COPY ./package-lock.json /XChainDecoder/package-lock.json
WORKDIR /XChainDecoder
RUN npm ci --omit=dev
COPY ./src /XChainDecoder/src
# Patch bitcoinjs-lib's bufferutils with a BigInt-aware 64-bit reader. The stock
# readUInt64 throws "RangeError: value out of range" for output values above
# ~9.007e15 (2^53), which Dogecoin mainnet exceeds (>~90.07M DOGE in one output).
# Mirrors xchain-utxo-tracker's identical patch. Belt-and-braces: the same patch
# is also applied in-process at require time (src/chain/apply_bufferutils_patch.js), so
# non-Docker runs and node_modules refreshes are covered even without this COPY.
COPY ./src/chain/bufferutils.js /XChainDecoder/node_modules/bitcoinjs-lib/src/bufferutils.js
# No .env is baked in: configuration reaches the container as environment
# (xchain-node at `docker run`, docker-compose.yml via env_file). An optional
# `COPY ./.en[v]` glob here builds only under BuildKit.
# Exec-form node, not `npm run api` (which is this exact command). npm builds an
# npm -> sh -c -> node tree and no wrapper forwards signals, so `docker stop`
# kills npm while node is never told anything (measured on the regtest encoder,
# xchain-encoder/Dockerfile). This image registers real drain work on SIGTERM
# (src/api.js: flip decoderRunning, then decoder.stop()), which only runs when
# node is PID 1 and receives the signal itself.
CMD ["node", "./src/api.js"]