lightning-terminal/dev.Dockerfile
Viktor Tigerström 1165e4d85a
proto + app: bump node + protoc & make protos
In the next commit, we'll bump our lnd dependency to `v0.18.3-beta`.
That version adds explicitly declared optional protos fields with commit
3de6c5415a

Optional proto fields are only available in Proto3 after protoc version
`3.15+`, and we therefore need to bump our protoc version for the protos
generation script to support them.

When doing so, we mimic the protobuf-compiler version used in `lnd`,
which is `3.21.12`. As protobuf-compiler 3.21.x+ is only available for
Node.js base images with Debian 12 (bookworm), we also update our NodeJS
base image to version 22.8.0-bookworm.
2024-09-16 12:50:55 +07:00

58 lines
1.9 KiB
Docker

# Start with a NodeJS base image that also contains yarn.
FROM node:22.8.0-alpine as nodejsbuilder
# Copy in the local repository to build from.
COPY . /go/src/github.com/lightninglabs/lightning-terminal
RUN cd /go/src/github.com/lightninglabs/lightning-terminal/app \
&& yarn install \
&& yarn build
# The first stage is already done and all static assets should now be generated
# in the app/build sub directory.
# If you change this value, please also update:
# /Dockerfile
# /.github/workflows/main.yml
FROM golang:1.22.3-alpine as golangbuilder
# Instead of checking out from git again, we just copy the whole working
# directory of the previous stage that includes the generated static assets.
COPY --from=nodejsbuilder /go/src/github.com/lightninglabs/lightning-terminal /go/src/github.com/lightninglabs/lightning-terminal
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
ENV GODEBUG netdns=cgo
# Install dependencies and install/build lightning-terminal.
RUN apk add --no-cache --update alpine-sdk \
make \
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
&& make go-install \
&& make go-install-cli
# Start a new, final image to reduce size.
FROM alpine as final
# Define a root volume for data persistence.
VOLUME /root/.lnd
# Expose lightning-terminal and lnd ports (server, rpc).
EXPOSE 8443 10009 9735
# Copy the binaries and entrypoint from the builder image.
COPY --from=golangbuilder /go/bin/litd /bin/
COPY --from=golangbuilder /go/bin/litcli /bin/
COPY --from=golangbuilder /go/bin/lncli /bin/
COPY --from=golangbuilder /go/bin/frcli /bin/
COPY --from=golangbuilder /go/bin/loop /bin/
COPY --from=golangbuilder /go/bin/pool /bin/
COPY --from=golangbuilder /go/bin/tapcli /bin/
# Add bash.
RUN apk add --no-cache \
bash \
jq \
ca-certificates
# Specify the start command and entrypoint as the lightning-terminal daemon.
ENTRYPOINT ["litd"]