Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated docker install of Pricenode #4041

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions pricenode/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
# first the builder builds the executables
###
# The directory of the Dockerfile should contain your 'hostname' and 'private_key' files.
# In the docker-compose.yml file you can pass the ONION_ADDRESS referenced below.
###

# pull base image
FROM openjdk:8-jdk
FROM gradle:jdk11 as builder
ARG BISQ_URL
ARG BISQ_BRANCH
RUN git clone $BISQ_URL
WORKDIR /home/gradle/bisq/
# git sometimes complains about this, can be bogus because we're not going to commit things
RUN git config --global user.email "[email protected]"
RUN git config --global user.name "Your Name"
RUN git fetch origin $BISQ_BRANCH && git checkout $BISQ_BRANCH
RUN git rev-parse --verify HEAD > git_head.txt
RUN ./gradlew :pricenode:installDist -x test < /dev/null
RUN chmod +x ./pricenode/build/app/bin/bisq-pricenode

# then the actual image is created, without gradle, using just the artifacts from the builder
###
FROM openjdk:10
EXPOSE 8000
RUN apt-get update && apt-get install -y --no-install-recommends \
vim \
tor \
fakeroot \
sudo \
openjfx && rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/bisq-network/pricenode.git
WORKDIR /pricenode/
RUN ./gradlew assemble

# copy the seednode artifact from the builder to the final container
RUN mkdir /home/bisq
COPY --from=builder /home/gradle/bisq/pricenode/build/app/bin/bisq-pricenode /home/bisq/bin/bisq-pricenode
COPY --from=builder /home/gradle/bisq/pricenode/build/app/lib /home/bisq/lib/
COPY --from=builder /home/gradle/bisq/git_head.txt /home/bisq/git_head.txt
WORKDIR /home/bisq/
COPY loop.sh start_node.sh start_tor.sh ./
COPY hostname private_key /var/lib/tor/
COPY torrc /etc/tor/
RUN chmod +x *.sh && chown debian-tor:debian-tor /etc/tor/torrc /var/lib/tor/hostname /var/lib/tor/private_key

CMD ./start_tor.sh && ./start_node.sh
#CMD tail -f /dev/null

41 changes: 12 additions & 29 deletions pricenode/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,26 @@
Needed information to start a pricenode
==
# Needed information to start a pricenode

Copy to this directory:
--
## Copy to this directory

* a tor `hostname` file, containing your onion address
* a tor `private_key` file, containing the private key for your tor hidden service
- a tor `hostname` file, containing your onion address
- a tor `private_key` file, containing the private key for your tor hidden service

Edit docker-compose.yml:
--
## Edit docker-compose.yml

* fill in your public and private api keys (needs a btcaverage developer subscription)
- fill in your public and private api keys (needs a bitcoinaverage.com developer subscription at the moment)
- optionally: update BISQ_URL and BISQ_BRANCH

Needed software to start a pricenode
==
## Needed software to start a pricenode

* docker
* docker-compose
- docker
- docker-compose

How to start
==
## How to start

`docker-compose up -d`


How to monitor
==
## How to monitor

See if it's running: `docker ps`

Check the logs: `docker-compose logs`


Notes when using CoreOs
==

Using CoreOs as host OS is entirely optional!

* the cloudconfig.yml file is a configuration file for starting a coreos machine
from scratch.
* when installing a Coreos server, docker-compose needs to be additionally installed next to the
already provided docker installation
4 changes: 4 additions & 0 deletions pricenode/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ version: '3'

services:
pricenode:
container_name: pricenode
restart: unless-stopped
build:
context: .
args:
- BISQ_URL=https://github.com/bisq-network/bisq.git
- BISQ_BRANCH=master
image: bisq:pricenode
ports:
- 80:80
Expand Down
2 changes: 1 addition & 1 deletion pricenode/docker/loop.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
while true
do
echo `date` "(Re)-starting node"
BITCOIN_AVG_PUBKEY=$BTCAVERAGE_PUBKEY BITCOIN_AVG_PRIVKEY=$BTCAVERAGE_PRIVKEY java -jar ./build/libs/bisq-pricenode.jar 2 2
BITCOIN_AVG_PUBKEY=$BTCAVERAGE_PUBKEY BITCOIN_AVG_PRIVKEY=$BTCAVERAGE_PRIVKEY ./bin/bisq-pricenode 2 2
echo `date` "node terminated unexpectedly!!"
sleep 3
done