Skip to content

Commit

Permalink
refactor: 💡 add to Dockerfile heredoc initialisation script for keyst…
Browse files Browse the repository at this point in the history
…ore init handling
  • Loading branch information
heldrida committed Sep 21, 2023
1 parent 0174398 commit 5ba6438
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion guides/Node Operators/running-a-node-in-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ touch Dockerfile
Copy and paste to the Dockerfile the following content:

```sh
# The Fleek Network Lightning Docker container is hosted at:
# https://github.com/fleek-network/lightning/pkgs/container/lightning
FROM rust:latest as build
WORKDIR /build

Expand Down Expand Up @@ -256,6 +258,9 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
cp /build/target/release/lightning-cli /build

FROM ubuntu:latest
ARG LIGHTNING_PORTS="4069 4200 6969 18000 18101 18102"
WORKDIR /root
SHELL ["/bin/bash", "-c"]

RUN apt-get update && \
apt-get install -y \
Expand All @@ -264,7 +269,21 @@ RUN apt-get update && \

COPY --from=build /build/lightning-cli /usr/local/bin/lgtn

ENTRYPOINT ["lgtn", "run"]
COPY <<EOF /root/init
#!/usr/bin/bash
if [[ ! -d /root/.lightning/keystore ]]; then
lgtn key generate
fi
lgtn run
EOF

RUN chmod +x /root/init

EXPOSE $LIGHTNING_PORTS

ENTRYPOINT ["/root/init"]
```

### Build the Docker image
Expand Down

0 comments on commit 5ba6438

Please sign in to comment.