Skip to content

dev.Dockerfile: allow skipping build of the web UI #1067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,22 @@ go-install-noui:
$(GOINSTALL) -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litd
$(GOINSTALL) -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litcli

go-install-cli:
go-install-cli-nolit:
@$(call print, "Installing all CLI binaries.")
$(GOINSTALL) -trimpath -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" github.com/lightningnetwork/lnd/cmd/lncli
$(GOINSTALL) -trimpath -ldflags "$(LDFLAGS)" github.com/lightninglabs/loop/cmd/loop
$(GOINSTALL) -trimpath github.com/lightninglabs/faraday/cmd/frcli
$(GOINSTALL) -trimpath -ldflags "$(LDFLAGS)" github.com/lightninglabs/pool/cmd/pool
$(GOINSTALL) -trimpath -ldflags "$(LDFLAGS)" github.com/lightninglabs/taproot-assets/cmd/tapcli

go-install-cli: go-install-cli-nolit
@$(call print, "Installing litcli binary.")
$(GOINSTALL) -trimpath -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litcli

go-install-cli-noui: go-install-cli-nolit
@$(call print, "Installing litcli binary without UI.")
$(GOINSTALL) -trimpath -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litcli

app-build: yarn-install
@$(call print, "Building production app.")
cd app; yarn build
Expand Down
23 changes: 19 additions & 4 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ RUN apk add --no-cache --update git
# Copy in the local repository to build from.
COPY . /go/src/github.com/lightninglabs/lightning-terminal

# Set to 1 to enable this option and skip build of the web UI.
ARG NO_UI

RUN cd /go/src/github.com/lightninglabs/lightning-terminal/app \
&& yarn install \
&& yarn build
&& if [ "$NO_UI" -eq "1" ]; then \
echo "skipping UI build";\
else \
yarn install \
&& yarn build; \
fi

# The first stage is already done and all static assets should now be generated
# in the app/build sub directory.
Expand All @@ -28,6 +35,9 @@ ENV GODEBUG netdns=cgo
# queries that can be used to define a version.
ARG TAPROOT_ASSETS_VERSION

# Need to restate this since running in a new container from above.
ARG NO_UI

# Install dependencies and install/build lightning-terminal.
RUN apk add --no-cache --update alpine-sdk make \
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
Expand All @@ -36,8 +46,13 @@ RUN apk add --no-cache --update alpine-sdk make \
go get -v github.com/lightninglabs/taproot-assets@$TAPROOT_ASSETS_VERSION \
&& go mod tidy; \
fi \
&& make go-install \
&& make go-install-cli
&& if [ "$NO_UI" -eq "1" ]; then \
make go-install-noui \
&& make go-install-cli-noui; \
else \
make go-install \
&& make go-install-cli; \
fi

# Start a new, final image to reduce size.
FROM alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d as final
Expand Down
Loading