From 56f96291e437e711c6dbbef3fc9b83bdd1d79468 Mon Sep 17 00:00:00 2001 From: nahuhh <50635951+nahuhh@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:45:04 +0000 Subject: [PATCH] doge: docker/production/* --- .../compose-fragments/1_dogecoin.yml | 16 ++++++++++++ docker/production/dogecoin/Dockerfile | 25 +++++++++++++++++++ docker/production/dogecoin/entrypoint.sh | 11 ++++++++ 3 files changed, 52 insertions(+) create mode 100644 docker/production/compose-fragments/1_dogecoin.yml create mode 100644 docker/production/dogecoin/Dockerfile create mode 100755 docker/production/dogecoin/entrypoint.sh diff --git a/docker/production/compose-fragments/1_dogecoin.yml b/docker/production/compose-fragments/1_dogecoin.yml new file mode 100644 index 0000000..6c50a1f --- /dev/null +++ b/docker/production/compose-fragments/1_dogecoin.yml @@ -0,0 +1,16 @@ + dogecoin_core: + image: i_dogecoin + build: + context: dogecoin + dockerfile: Dockerfile + container_name: dogecoin_core + volumes: + - ${DATA_PATH}/dogecoin:/data + expose: + - ${DOGE_RPC_PORT} + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + restart: unless-stopped diff --git a/docker/production/dogecoin/Dockerfile b/docker/production/dogecoin/Dockerfile new file mode 100644 index 0000000..4630e69 --- /dev/null +++ b/docker/production/dogecoin/Dockerfile @@ -0,0 +1,25 @@ +FROM i_swapclient as install_stage + +RUN basicswap-prepare --preparebinonly --bindir=/coin_bin --withcoin=dogecoin --withoutcoin=particl && \ + find /coin_bin -name *.tar.gz -delete + +FROM debian:bullseye-slim +COPY --from=install_stage /coin_bin . + +ENV DOGECOIN_DATA /data + +RUN groupadd -r dogecoin && useradd -r -m -g dogecoin dogecoin \ + && apt-get update \ + && apt-get install -qq --no-install-recommends gosu \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir "$DOGECOIN_DATA" \ + && chown -R dogecoin:dogecoin "$DOGECOIN_DATA" \ + && ln -sfn "$DOGECOIN_DATA" /home/dogecoin/.dogecoin \ + && chown -h dogecoin:dogecoin /home/dogecoin/.dogecoin +VOLUME /data + +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] + +EXPOSE 8332 8333 18332 18333 18443 18444 +CMD ["/dogecoin/dogecoind", "--datadir=/data"] diff --git a/docker/production/dogecoin/entrypoint.sh b/docker/production/dogecoin/entrypoint.sh new file mode 100755 index 0000000..5355869 --- /dev/null +++ b/docker/production/dogecoin/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +if [[ "$1" == "dogecoin-cli" || "$1" == "dogecoin-tx" || "$1" == "dogecoind" || "$1" == "test_dogecoin" ]]; then + mkdir -p "$DOGECOIN_DATA" + + chown -h dogecoin:dogecoin /home/dogecoin/.dogecoin + exec gosu dogecoin "$@" +else + exec "$@" +fi