Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (50 loc) · 2.3 KB
/
Copy pathDockerfile
File metadata and controls
65 lines (50 loc) · 2.3 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Build Stage
FROM node:22-bookworm@sha256:8a34c4ab3ea2c5cd194f07e317b2a8f09461d3c8b05c4e34c8ccd56d56024c4d AS cln-app-builder
# Install system dependencies (native modules pulled in by the test tooling)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
python3 \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy project files and folders
COPY apps/backend ./apps/backend
COPY apps/frontend ./apps/frontend
COPY package.json ./
COPY package-lock.json ./
# Install dependencies
RUN npm ci
# Build assets
RUN npm run build
# Prune development dependencies
RUN npm prune --omit=dev
# Final image
FROM node:22-bookworm-slim@sha256:83f487e0a63425e5b4d146fb5e5be574bcbe1b7b843d3ebafdd95eaf7767a7e5 AS cln-app-final
# Install jq and socat for scripts/entrypoint.sh
RUN apt-get update && apt-get install -y --no-install-recommends jq socat \
&& rm -rf /var/lib/apt/lists/*
# Copy built code from build stages to '/app/frontend' directory
COPY --from=cln-app-builder /app/apps/frontend/build /app/apps/frontend/build
COPY --from=cln-app-builder /app/apps/frontend/public /app/apps/frontend/public
COPY --from=cln-app-builder /app/apps/frontend/package.json /app/apps/frontend/package.json
# Copy built code from build stages to '/app/backend' directory
COPY --from=cln-app-builder /app/apps/backend/dist /app/apps/backend/dist
COPY --from=cln-app-builder /app/apps/backend/proto /app/apps/backend/proto
COPY --from=cln-app-builder /app/apps/backend/package.json /app/apps/backend/package.json
# Copy built code from build stages to '/app' directory
COPY --from=cln-app-builder /app/package-lock.json /app/package-lock.json
COPY --from=cln-app-builder /app/package.json /app/package.json
COPY --from=cln-app-builder /app/node_modules /app/node_modules
# Change directory to '/app'
WORKDIR /app
COPY scripts/entrypoint.sh scripts/entrypoint.sh
# The process stays root on purpose: the entrypoint reads the node's RPC
# socket and writes the commando env file inside the mounted lightning data
# directory, which platform packages (Umbrel, StartOS) mount root-owned.
# Run with `--user` or compose `user:` when your mounts allow it.
ENTRYPOINT ["bash", "./scripts/entrypoint.sh"]