From b7abff22302b19ae6c3c668260995fff5ecde74c Mon Sep 17 00:00:00 2001 From: studmix88 Date: Wed, 9 Mar 2022 13:34:21 -0600 Subject: [PATCH] =?UTF-8?q?Dockerfile=20=D0=B4=D0=BB=D1=8F=20bitdeals-dm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile | 4 +-- docker/README.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++ docker/info.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 docker/README.md create mode 100644 docker/info.md diff --git a/docker/Dockerfile b/docker/Dockerfile index 691c1b5..9bcd432 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -62,8 +62,8 @@ RUN set -ex ; su -l --shell /bin/bash $UNAME -c 'cd '$UHOME' ; \ rm -Rf $UHOME/apostol-dm ## Copy configuration helper script -#ADD https://bitbucket.org/bitdeals/apostol-dm/docker/entrypoint.sh /entrypoint.sh -COPY ./entrypoint.sh /entrypoint.sh +ADD https://bitbucket.org/bitdeals/apostol-dm/raw/master/docker/entrypoint.sh /entrypoint.sh +#COPY ./entrypoint.sh /entrypoint.sh RUN set -ex ; chmod 755 /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..4feaff7 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,82 @@ +# Intro + +Deal Module - the BitDeals daemon that provides a special interfaces for creating and modifying user accounts and deals. + +# Running DM docker container + +On first run the initialization script will create and save a new bitcoin and PGP keys and start the daemon. + +`docker run -i -t --rm --mount src=bitdeals-conf,dest=/etc/dm -p 127.0.0.1:4977:4977 -p 127.0.0.1:80:80 bitdeals/dm` + +Daemon settings which may specified by an environment variables are saved to the daemon config file on the Docker Volume. + +To use the BitDeals API you should register an user account on a BitDeals site and get a "client_id", "client_secret" at the account dashboard. + +# Usage + +Here are some example snippets to help you get started creating a container. + +## docker-compose [(recommended, click here for more info)](https://docs.linuxserver.io/general/docker-compose) + +```yaml +version: "3" +services: + bitdeals-module: + image: bitdeals/apostol-dm + container_name: bitdeals-dm + environment: + - PUID=1000 + - PGID=1000 + - TZ=UTC + - BITCOIN=
#optional + - FEE=<0.1%> #optional + - PGP_PUB= #optional + - PGP_SEC= #optional + - PASSWORD= #optional + - ACCOUNT_URL= #optional + - CLIENT_ID= #optional + - CLIENT_SECRET= #optional + volumes: + - bitdeals-conf:/etc/dm + ports: + - 4977:4977/tcp + - 80:80/tcp + restart: unless-stopped +``` + +## docker cli [(click here for more info)](https://docs.docker.com/engine/reference/commandline/cli/) + +```sh +docker run -d \ + --name=bitdeals-dm \ + -e BITCOIN=
`#optional` \ + -e FEE=<0.1%> `#optional` \ + -e PGP_PUB=$(gpg2 --armor --export Account_URL) `#optional` \ + -e PGP_SEC=$(gpg2 --armor --export-secret-key Account_URL) `#optional` \ + -e PASSWORD= `#optional` \ + -e ACCOUNT_URL= `#optional` \ + -e CLIENT_ID= `#optional` \ + -e CLIENT_SECRET= `#optional` \ + -p 127.0.0.1:4977:4977 \ + -p 127.0.0.1:80:80 \ + -v bitdeals-conf:/etc/dm \ + bitdeals/apostol-dm +``` + +# Parameters + +Container images are configured using parameters passed at runtime. + +|Parameter|Function| +|:--------|:-------| +|-p 80|WebUI port TCP| +|-p 4977|Module API port TCP [(API documentation)](https://bitbucket.org/bitdeals/apostol-dm)| +|-e ACCOUNT_URL=|User site address to provide a deal service. On first run the initialization script will create and save a new PGP keys with this Account_URL in key details.| +|-e BITCOIN=|User account bitcoin address.| +|-e FEE=|User fee for created deals.| +|-e PGP_PUB=|Variable with ASCII armored PGP public key.| +|-e PGP_SEC=|Variable with ASCII armored PGP secret key.| +|-e PASSWORD=|User PGP key password.| +|-e CLIENT_ID=|API access credentials (get it on a BitDeals site at User dashboard).| +|-e CLIENT_SECRET=|API access credentials (get it on a BitDeals site at User dashboard).| + diff --git a/docker/info.md b/docker/info.md new file mode 100644 index 0000000..0d3cd05 --- /dev/null +++ b/docker/info.md @@ -0,0 +1,82 @@ +# Intro + +Deal Module - the BitDeals daemon that provides a special interfaces for creating and modifying user accounts and deals. + +# Running DM docker container + +On first run the initialization script will create and save a new bitcoin and PGP keys and start the daemon. + +`docker run -i -t --rm --mount src=bitdeals-conf,dest=/etc/dm -p 127.0.0.1:4977:4977 -p 127.0.0.1:80:80 bitdeals/dm` + +Daemon settings which may specified by an environment variables are saved to the daemon config file on the Docker Volume. + +To use the BitDeals API you should register an user account on a BitDeals site and get a "client_id", "client_secret" at the account dashboard. + +# Usage + +Here are some example snippets to help you get started creating a container. + +## docker-compose [(recommended, click here for more info)](https://docs.linuxserver.io/general/docker-compose) + +```yaml +version: "3" +services: + bitdeals-module: + image: bitdeals/dm + container_name: bitdeals-dm + environment: + - PUID=1000 + - PGID=1000 + - TZ=UTC + - BITCOIN=
#optional + - FEE=<0.1%> #optional + - PGP_PUB= #optional + - PGP_SEC= #optional + - PASSWORD= #optional + - ACCOUNT_URL= #optional + - CLIENT_ID= #optional + - CLIENT_SECRET= #optional + volumes: + - bitdeals-conf:/etc/dm + ports: + - 4977:4977/tcp + - 80:80/tcp + restart: unless-stopped +``` + +## docker cli [(click here for more info)](https://docs.docker.com/engine/reference/commandline/cli/) + +```sh +docker run -d \ + --name=bitdeals-dm \ + -e BITCOIN=
`#optional` \ + -e FEE=<0.1%> `#optional` \ + -e PGP_PUB=$(gpg2 --armor --export Account_URL) `#optional` \ + -e PGP_SEC=$(gpg2 --armor --export-secret-key Account_URL) `#optional` \ + -e PASSWORD= `#optional` \ + -e ACCOUNT_URL= `#optional` \ + -e CLIENT_ID= `#optional` \ + -e CLIENT_SECRET= `#optional` \ + -p 127.0.0.1:4977:4977 \ + -p 127.0.0.1:80:80 \ + -v bitdeals-conf:/etc/dm \ + bitdeals/dm +``` + +# Parameters + +Container images are configured using parameters passed at runtime. + +|Parameter|Function| +|:--------|:-------| +|-p 80|WebUI port TCP| +|-p 4977|Module API port TCP [(API documentation)](https://bitbucket.org/bitdeals/apostol-dm)| +|-e ACCOUNT_URL=|User site address to provide a deal service. On first run the initialization script will create and save a new PGP keys with this Account_URL in key details.| +|-e BITCOIN=|User account bitcoin address.| +|-e FEE=|User fee for created deals.| +|-e PGP_PUB=|Variable with ASCII armored PGP public key.| +|-e PGP_SEC=|Variable with ASCII armored PGP secret key.| +|-e PASSWORD=|User PGP key password.| +|-e CLIENT_ID=|API access credentials (get it on a BitDeals site at User dashboard).| +|-e CLIENT_SECRET=|API access credentials (get it on a BitDeals site at User dashboard).| +