Dockerfile: use env vars for consistency
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
This commit is contained in:
parent
b04cfd3a00
commit
19d8906e38
@ -146,9 +146,9 @@ COPY --from=builder /usr/local/bin/summars /usr/local/src/plugins/summars
|
|||||||
COPY --from=vls_builder /usr/local/bin/remote_hsmd_socket /usr/libexec/c-lightning/remote_hsmd_socket
|
COPY --from=vls_builder /usr/local/bin/remote_hsmd_socket /usr/libexec/c-lightning/remote_hsmd_socket
|
||||||
COPY --from=builder /build/core-lightning/plugins/clnrest/requirements.txt /usr/local/src/plugins/clnrest_requirements.txt
|
COPY --from=builder /build/core-lightning/plugins/clnrest/requirements.txt /usr/local/src/plugins/clnrest_requirements.txt
|
||||||
|
|
||||||
RUN addgroup -S lightning && adduser -S lightning -G lightning && \
|
RUN addgroup -S ${LIGHTNINGD_USER} && adduser -S ${LIGHTNINGD_USER} -G ${LIGHTNINGD_USER} && \
|
||||||
mkdir -p ${LIGHTNINGD_DATA} && \
|
mkdir -p ${LIGHTNINGD_DATA} && \
|
||||||
chown -R lightning:lightning ${LIGHTNINGD_DATA}
|
chown -R ${LIGHTNINGD_USER}:${LIGHTNINGD_USER} ${LIGHTNINGD_DATA}
|
||||||
|
|
||||||
COPY bitcoin.conf ${BITCOIND_HOME}/bitcoin.conf
|
COPY bitcoin.conf ${BITCOIND_HOME}/bitcoin.conf
|
||||||
|
|
||||||
@ -161,13 +161,13 @@ RUN chmod +x /healthcheck.sh
|
|||||||
VOLUME ["${LIGHTNINGD_DATA}"]
|
VOLUME ["${LIGHTNINGD_DATA}"]
|
||||||
|
|
||||||
RUN mkdir -p ${BITCOIND_HOME} && \
|
RUN mkdir -p ${BITCOIND_HOME} && \
|
||||||
chown -R lightning:lightning ${BITCOIND_HOME}
|
chown -R ${LIGHTNINGD_USER}:${LIGHTNINGD_USER} ${BITCOIND_HOME}
|
||||||
|
|
||||||
COPY bitcoin.conf ${BITCOIND_HOME}/bitcoin.conf
|
COPY bitcoin.conf ${BITCOIND_HOME}/bitcoin.conf
|
||||||
COPY testnet-config /testnet-config
|
COPY testnet-config /testnet-config
|
||||||
COPY regtest-config /regtest-config
|
COPY regtest-config /regtest-config
|
||||||
|
|
||||||
USER lightning
|
USER ${LIGHTNINGD_USER}
|
||||||
|
|
||||||
RUN pip3 install \
|
RUN pip3 install \
|
||||||
pyln-client \
|
pyln-client \
|
||||||
|
@ -24,14 +24,16 @@ RUN cd vls && \
|
|||||||
|
|
||||||
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner
|
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner
|
||||||
|
|
||||||
ARG UID=100
|
ARG VLSD_UID=100 \
|
||||||
ARG GID=101
|
VLSD_GID=101 \
|
||||||
|
VLSD_USER=vls
|
||||||
|
ARG VLSD_HOME=/home/${VLSD_USER}
|
||||||
|
|
||||||
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
||||||
maintainer.1="Dev Random (@devrandom01)"
|
maintainer.1="Dev Random (@devrandom01)"
|
||||||
|
|
||||||
RUN addgroup vls --gid ${GID} --system
|
RUN addgroup ${VLSD_USER} --gid ${VLSD_GID} --system
|
||||||
RUN adduser --uid ${UID} --system vls --ingroup vls
|
RUN adduser --uid ${VLSD_UID} --system ${VLSD_USER} --ingroup ${VLSD_USER}
|
||||||
|
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk add \
|
apk add \
|
||||||
@ -52,16 +54,16 @@ RUN chmod +x /healthcheck.sh
|
|||||||
|
|
||||||
COPY vlsd2.toml /vlsd2.toml
|
COPY vlsd2.toml /vlsd2.toml
|
||||||
|
|
||||||
ENV VLS_DATA=/home/vls/.lightning-signer
|
ENV VLSD_DATA=/home/vls/.lightning-signer
|
||||||
RUN mkdir ${VLS_DATA}
|
RUN mkdir -p ${VLSD_DATA} && \
|
||||||
RUN chown vls:vls ${VLS_DATA}
|
chown ${VLSD_USER}:${VLSD_USER} ${VLSD_DATA}
|
||||||
|
|
||||||
ENV REMOTE_SIGNER_ALLOWLIST=${VLS_DATA}/ALLOWLIST
|
ENV REMOTE_SIGNER_ALLOWLIST=${VLSD_DATA}/ALLOWLIST
|
||||||
RUN touch ${REMOTE_SIGNER_ALLOWLIST}
|
RUN touch ${REMOTE_SIGNER_ALLOWLIST}
|
||||||
|
|
||||||
VOLUME ["${VLS_DATA}"]
|
VOLUME ["${VLSD_DATA}"]
|
||||||
|
|
||||||
USER vls
|
USER ${VLSD_USER}
|
||||||
|
|
||||||
HEALTHCHECK --interval=10s --timeout=10s --start-period=10s \
|
HEALTHCHECK --interval=10s --timeout=10s --start-period=10s \
|
||||||
CMD ["/healthcheck.sh"]
|
CMD ["/healthcheck.sh"]
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cp /vlsd2.toml $VLS_DATA/
|
cp /vlsd2.toml $VLSD_DATA/
|
||||||
sed -i "1s/^/network = \"$VLS_NETWORK\"\n/" $VLS_DATA/vlsd2.toml
|
sed -i "1s/^/network = \"$VLS_NETWORK\"\n/" $VLSD_DATA/vlsd2.toml
|
||||||
|
|
||||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||||
echo "$0: assuming arguments for vlsd2"
|
echo "$0: assuming arguments for vlsd2"
|
||||||
@ -11,9 +11,9 @@ if [ $(echo "$1" | cut -c1) = "-" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "vlsd2" ]; then
|
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "vlsd2" ]; then
|
||||||
echo "$0: setting config to $VLS_DATA/vlsd2.toml"
|
echo "$0: setting config to $VLSD_DATA/vlsd2.toml"
|
||||||
|
|
||||||
set -- "$@" --config=$VLS_DATA/vlsd2.toml
|
set -- "$@" --config=$VLSD_DATA/vlsd2.toml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user