Skip to content

Commit fc77836

Browse files
committed
make+app: add dockerized builder for app
We dockerize the app build and use that for both the docker build _AND_ the normal build to make sure the static content is fully reproducible across different systems.
1 parent 321d93c commit fc77836

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,17 @@ app-build: yarn-install
164164
@$(call print, "Building production app.")
165165
cd app; yarn build
166166

167-
release: app-build go-release
167+
docker-app-build:
168+
@$(call print, "Building production app in docker.")
169+
cd app; ./gen_app_docker.sh
170+
171+
release: docker-app-build go-release
168172

169173
go-release:
170174
@$(call print, "Creating release of lightning-terminal.")
171175
./scripts/release.sh build-release "$(VERSION_TAG)" "$(BUILD_SYSTEM)" "$(LND_RELEASE_TAGS)" "$(RELEASE_LDFLAGS)" "$(GO_VERSION)"
172176

173-
docker-release: app-build
177+
docker-release: docker-app-build
174178
@$(call print, "Building release helper docker image.")
175179
if [ "$(tag)" = "" ]; then echo "Must specify tag=<commit_or_tag>!"; exit 1; fi
176180

app/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Start with a NodeJS base image that also contains yarn.
2+
FROM node:22.8.0-bookworm@sha256:bd00c03095f7586432805dbf7989be10361d27987f93de904b1fc003949a4794 as nodejsbuilder
3+
4+
RUN apt-get update && apt-get install -y git
5+
6+
ENV HOME=/tmp
7+
8+
RUN mkdir /build
9+
10+
WORKDIR /build
11+
12+
CMD ["/bin/bash", "-c", "chown $(id -u):$(id -g) /build && cd app && rm -rf node_modules && yarn cache clean && yarn install && yarn build"]

app/gen_app_docker.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Directory of the script file, independent of where it's called from.
6+
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
7+
8+
echo "Building app compiler docker image..."
9+
docker build -q -t lit-app-builder .
10+
11+
echo "Compiling app files..."
12+
docker run \
13+
--rm \
14+
--user $(id -u):$(id -g) \
15+
-v "$DIR/../:/build" \
16+
lit-app-builder

0 commit comments

Comments
 (0)