2020-12-09 17:47:17 +01:00
|
|
|
# Start with a NodeJS base image that also contains yarn.
|
2022-04-03 01:02:27 -04:00
|
|
|
FROM node:16.14.2-alpine as nodejsbuilder
|
2020-11-25 15:28:51 +01:00
|
|
|
|
|
|
|
|
# Copy in the local repository to build from.
|
|
|
|
|
COPY . /go/src/github.com/lightninglabs/lightning-terminal
|
|
|
|
|
|
2020-12-09 17:47:17 +01:00
|
|
|
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.
|
2021-12-14 18:50:16 +01:00
|
|
|
# If you change this value, please also update:
|
|
|
|
|
# /Dockerfile
|
|
|
|
|
# /.github/workflows/main.yml
|
2023-03-10 16:29:05 -08:00
|
|
|
FROM golang:1.19-alpine as golangbuilder
|
2020-12-09 17:47:17 +01:00
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
2020-11-25 15:28:51 +01:00
|
|
|
# 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 \
|
2022-04-03 01:02:27 -04:00
|
|
|
make \
|
2020-12-09 17:47:17 +01:00
|
|
|
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
|
|
|
|
|
&& make go-install \
|
|
|
|
|
&& make go-install-cli
|
2020-11-25 15:28:51 +01:00
|
|
|
|
|
|
|
|
# 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.
|
2020-12-09 17:47:17 +01:00
|
|
|
COPY --from=golangbuilder /go/bin/litd /bin/
|
2021-10-29 14:50:32 +02:00
|
|
|
COPY --from=golangbuilder /go/bin/litcli /bin/
|
2020-12-09 17:47:17 +01:00
|
|
|
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/
|
2020-11-25 15:28:51 +01:00
|
|
|
|
|
|
|
|
# Add bash.
|
|
|
|
|
RUN apk add --no-cache \
|
2022-04-03 01:02:27 -04:00
|
|
|
bash \
|
|
|
|
|
jq \
|
|
|
|
|
ca-certificates
|
2020-11-25 15:28:51 +01:00
|
|
|
|
|
|
|
|
# Specify the start command and entrypoint as the lightning-terminal daemon.
|
|
|
|
|
ENTRYPOINT ["litd"]
|