update docs and dockefile, adjust nproc to variable again

This commit is contained in:
Ian Munoz 2019-01-17 19:55:45 +00:00
parent df4a277750
commit c360973c6b
3 changed files with 52 additions and 7 deletions

View File

@ -1,10 +1,7 @@
FROM debian:latest
# Run 'docker build .' from github clone
# docker run -p80:3001 -v $(pwd)/dot-zcash:/home/zcashd/.zcash
RUN apt-get update \
&& apt-get install -y gnupg2 wget libzmq3-dev git \
# zcash build (see RTD User Guide):
&& apt-get -qqy install \
build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python python-zmq \
@ -29,8 +26,7 @@ RUN git clone https://github.com/zcash-hackworks/zcash-patched-for-explorer.git
WORKDIR /home/zcashd/zcash-patched-for-explorer
RUN git checkout v2.0.2-insight-explorer
# keep jobs low to minimize chances of running out of memory
RUN zcutil/build.sh -j2
RUN zcutil/build.sh -j$(nproc)
RUN zcutil/fetch-params.sh
WORKDIR /home/zcashd/

View File

@ -2,7 +2,7 @@ This repo contains a Dockerfile to run and set up an insight explorer for the Zc
To build the image run:
`docker build -t ianamunoz/zcash-insight-explorer:v1.1.1 .`
`docker build -t ianamunoz/zcash-insight-explorer .`
* Note that this build will pull in all the parameters so it is a bit heavy at 2.48GB. It will require some bandwidth and beware of your /var/lib directory if you have a default docker install.
@ -11,7 +11,11 @@ To run locally without to test operation run:
```
docker run -d \
-p 80:3001 \
ianamunoz/zcash-insight-explorer:v1.1.1
ianamunoz/zcash-insight-explorer
```
The `docker-service.sh` file shows you might might manually run it as a service behind a traefik reverse proxy as seen for example in the `docker-compose.yml`.
ToDo: tags for versions
Set up ad-hoc [Google Cloud](.docs/ad_hoc_gcp.md) instance.

45
docs/ad_hoc_gcp.md Normal file
View File

@ -0,0 +1,45 @@
Create an instance:
```
gcloud compute instances create testnet-explorer \
--zone=us-east1-b \
--machine-type=n1-standard-1 \
--subnet=default \
--network-tier=PREMIUM \
--tags=https-server \
--image=debian-9 \
--image-project=debian-cloud \
--boot-disk-size=24GB \
--boot-disk-type=pd-standard \
--boot-disk-device-name=testnet-explorer
```
ssh into the instance and install docker (using debian here for sanity)
```
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermad -aG $(whoami) docker
```
update and install dependencies
```
sudo apt-get update -y && sudo apt-get upgrade
sudo apt-get install git
```
Clone repo and build image
```
git clone https://github.com/ianamunoz/zcash-insight-explorer.git
cd zcash-insight-explorer
docker build -t zcash-hackworks/zcash-insight-explorer .
```
**Edit `docker-compose.yml` and edit your host records etc.**
**Add DNS records to your public instance IP**
Stand up the stack:
```
docker stack deploy --compose-file docker-compose.yml testnet-explorer
```
Visit your domain to pick up letsencrypt cert.
Fin.