-
Notifications
You must be signed in to change notification settings - Fork 783
Expand file tree
/
Copy pathmetachronik.Dockerfile
More file actions
48 lines (36 loc) · 1.64 KB
/
metachronik.Dockerfile
File metadata and controls
48 lines (36 loc) · 1.64 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright (c) 2026 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
FROM node:22-trixie-slim
# Install pnpm
RUN npm install -g pnpm
# Set working directory to monorepo root
WORKDIR /app
# Copy workspace files
COPY pnpm-workspace.yaml .
COPY pnpm-lock.yaml .
COPY package.json .
# Copy package.json files for dependency resolution
COPY modules/ecashaddrjs/package.json ./modules/ecashaddrjs/
COPY modules/chronik-client/package.json ./modules/chronik-client/
COPY apps/metachronik/package.json ./apps/metachronik/
# Fetch dependencies (pnpm best practice for Docker)
RUN pnpm fetch --frozen-lockfile
# Copy source files
COPY modules/ecashaddrjs/ ./modules/ecashaddrjs/
COPY modules/chronik-client/ ./modules/chronik-client/
COPY apps/metachronik/ ./apps/metachronik/
# Install dependencies for local modules first
RUN pnpm install --frozen-lockfile --offline --filter ecashaddrjs...
RUN pnpm install --frozen-lockfile --offline --filter chronik-client...
# Build local modules (dependencies first)
RUN pnpm --filter ecashaddrjs run build
RUN pnpm --filter chronik-client run build
# Install dependencies for metachronik (now that local modules are built)
RUN pnpm install --frozen-lockfile --offline --filter metachronik...
# Build metachronik from monorepo root
RUN pnpm --filter metachronik run build
# metachronik runs with "node --max-old-space-size=4096 dist/index.js" from the app directory
# It uses .env file for configuration (DATABASE_URL, CHRONIK_URL, etc.)
WORKDIR /app/apps/metachronik
CMD [ "node", "--max-old-space-size=4096", "dist/index.js" ]