Skip to content

Commit

Permalink
Merge pull request #6 from lisandrogallo/master
Browse files Browse the repository at this point in the history
Dockerfile updated and Docker Compose file added
  • Loading branch information
maxidev committed Apr 26, 2018
2 parents ba16ad4 + 4efe576 commit 22bd9fe
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TAG=latest
NODE_NAME=some-name
37 changes: 20 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@ VOLUME ["/data" ]

WORKDIR /root

ADD ./config.toml ./
ADD ./nodes.txt ./
ADD ./genesis.json ./
ADD ./docker-entrypoint /usr/local/bin/

RUN chmod +x /usr/local/bin/docker-entrypoint

# Install node
# Install NodeJS
RUN apt-get update \
&& apt-get install -y curl git perl \
&& curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - \
&& apt-get install nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& npm install -g pm2
&& apt-get install -y curl git perl wget \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
&& apt-get upgrade -y \
&& curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - \
&& apt-get install -y nodejs \
&& npm install -g pm2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& apt-get autoremove -y

# Install netstat client
# Install Ethereum Network Intelligence API
RUN git clone https://github.com/cryptol0g1c/eth-net-intelligence-api.git \
&& cd eth-net-intelligence-api \
&& npm install
&& cd eth-net-intelligence-api \
&& npm install

COPY ./config.toml ./
COPY ./nodes.txt ./
COPY ./genesis.json ./
COPY ./docker-entrypoint /usr/local/bin/

RUN chmod +x /usr/local/bin/docker-entrypoint

ENTRYPOINT ["docker-entrypoint"]
37 changes: 15 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,41 +76,34 @@ enode://399eb9b379410a66c80899cf03bec59bce930cd6f8a8440e6c8601c881f68d994f054f29
Parity software can be downloaded [here](https://github.com/paritytech/parity/releases/tag/v1.9.2) (version 1.9.x+ recommended)

#### Configuration file

For a quick run you can use the simple yet working config file to start Parity below:
[config.toml](https://github.com/cryptol0g1c/bitsign-federation/blob/master/config.toml)



#### Command line
#### Command line

For running Parity on Bitsign Federation an example command line can be:
```
$ parity --config config.toml
```

#### Building using Docker
#### Running a Bitsign node using Docker

To Parity from a Docker container, you must clon this repository and then build the image with this command:
```
$ docker build -t bitsign-federation .
docker run --detach \
--name bitsign-node \
-e NODE_NAME=some-name \
--restart=unless-stopped \
cryptologic/bitsign-node:latest
```

To persist the blockchain data you can create a named volume:
```
docker volume create --name=bitsign-federation-data
```

Then when the image building process finish, create the container with this command:
```
$ docker run --name=bitsign-federation-node \
-v bitsign-federation-data:/data \
-e NODE_NAME=some-name \
bitsign-federation --config config.toml
```
The `NODE_NAME` environment variable is for set an references name for the
statistic explorer, you can choose whatever you want.

Note: If you want a quick run you can use `config.toml` file, or you can replace `--config config.toml` with the configuration you need.
The *NODE_NAME* environment variable is a reference name for the statistics explorer, you can choose whatever you want.

##### Using Docker Compose

Edit the `.env` file and set the environment variables *TAG* and *NODE_NAME*, then run `docker-compose`:

```
nano .env
docker-compose up -d
```
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'
services:
bitsign-node:
image: cryptologic/bitsign-node:${TAG}
restart: unless-stopped
environment:
- NODE_NAME=${NODE_NAME}
volumes:
- bitsign-federation-data:/data

volumes:
bitsign-federation-data:
2 changes: 1 addition & 1 deletion docker-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ pm2 startup
pm2 save

cd /root
/parity/parity --base-path /data $@
/parity/parity --config /root/config.toml --base-path /data $@

0 comments on commit 22bd9fe

Please sign in to comment.