File tree 1 file changed +14
-7
lines changed
1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -28,28 +28,35 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
28
28
29
29
FROM ubuntu:latest
30
30
ARG LIGHTNING_PORTS="4200-4299 4300-4399"
31
- WORKDIR /root
31
+ ARG USERNAME="lgtn"
32
+ WORKDIR /home/$USERNAME
32
33
SHELL ["/bin/bash" , "-c" ]
33
34
34
35
RUN apt-get update && \
35
36
apt-get install -y \
36
37
libssl-dev \
37
- ca-certificates
38
+ ca-certificates \
39
+ curl
38
40
39
41
COPY --from=build /build/lightning-node /usr/local/bin/lgtn
40
42
41
- COPY <<EOF /root/init
43
+ RUN useradd -Um $USERNAME
44
+
45
+ COPY <<EOF /home/$USERNAME/init
42
46
# !/usr/bin/bash
43
47
44
- if [[ ! -d /root /.lightning/keystore ]]; then
48
+ if [[ ! -d /home/$USERNAME /.lightning/keystore ]]; then
45
49
lgtn keys generate
46
50
fi
47
51
48
- lgtn -vv run
52
+ lgtn -c /home/$USERNAME/.lightning/config.toml - vv run
49
53
EOF
50
54
51
- RUN chmod +x /root/init
55
+ RUN chown $USERNAME:$USERNAME /home/$USERNAME/init
56
+ RUN chmod +x /home/$USERNAME/init
52
57
53
58
EXPOSE $LIGHTNING_PORTS
54
59
55
- ENTRYPOINT ["/root/init" ]
60
+ USER $USERNAME
61
+
62
+ ENTRYPOINT ["/home/lgtn/init" ]
You can’t perform that action at this time.
0 commit comments