Updated docker-compose format

This commit is contained in:
Ben Wilson 2019-10-21 16:10:15 -04:00
parent e20b8f7d56
commit 67cef460f4
5 changed files with 59 additions and 13 deletions

View File

@ -1,8 +1,14 @@
version: '3'
services:
web:
nginx:
build:
context: docker/nginx
zfaucet:
build: .
volumes:
- ./:/app
- static_volume:/home/zcashd/zfaucet/faucet/static
zcashd:
build:
context: docker/zcashd

View File

@ -1 +1,12 @@
version: '3'
services:
nginx:
image: gcr.io/zcash-web/github.com/benzcash/zfaucet-nginx:7cea8a4
volumes:
- /secrets/letsencrypt/faucet.testnet.z.cash.pem:/ssl/faucet.testnet.z.cash.pem
- /secrets/letsencrypt/faucet.testnet.z.cash-private.key:/ssl/faucet.testnet.z.cash-private.key
- static_volume:/usr/share/nginx/html/static
zfaucet:
image: gcr.io/zcash-web/github.com/benzcash/zfaucet@sha256:e11400106d121e12bf931145199a2adcb18d7c10e7dbf07aa58b2fe21b450fa5
zcashd:
image: gcr.io/zcash-web/github.com/benzcash/zfaucet-zcashd@sha256:9ca439a3ff74c17dd72fb08c721e40fd894a8d472bcc1add5dbc6f84134bdca9

View File

@ -9,7 +9,7 @@ services:
POSTGRES_USER: django
ports:
- "5432:5432"
web:
nginx:
ports:
- "80:80"
- "443:443"
@ -34,14 +34,22 @@ services:
RPCPASSWORD: $RPCPASSWORD
ZCASH_NETWORK: http://zcashd:18232
zcashd:
build:
context: docker/zcashd
command: zcashd
environment:
ZCASHD_NETWORK: $ZCASHD_NETWORK
ZCASHD_SHOWMETRICS: "1"
ZCASHD_LOGIPS: "1"
ZCASHD_EXPERIMENTALFEATURES: "1"
ZCASHD_GEN: "1"
ZCASHD_ZSHIELDCOINBASE: "1"
ZCASHD_RPCUSER: $RPCUSER
ZCASHD_RPCPASSWORD: $RPCPASSWORD
ZCASHD_RPCBIND: "0.0.0.0"
ZCASHD_ALLOWIP: "0.0.0.0/0"
ports:
- "18232:18232"
volumes:
- $ZCASHD_DATADIR:/home/zcashd/.zcash
- $ZCASHD_PARMDIR:/home/zcashd/.zcash-params
- $ZCASHD_DATADIR:/srv/zcashd/.zcash
- $ZCASHD_PARMDIR:/srv/zcashd/.zcash-params
volumes:
static_volume:

View File

@ -13,15 +13,15 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $ZCASH_SIG
&& apt-get update \
&& apt-get install -y zcash=$ZCASH_VERSION
RUN useradd --home-dir /home/$ZCASHD_USER \
RUN useradd --home-dir /srv/$ZCASHD_USER \
--shell /bin/bash \
--create-home \
--uid $ZCASHD_UID\
$ZCASHD_USER
USER $ZCASHD_USER
WORKDIR /home/zcashd
RUN mkdir -p /home/$ZCASHD_USER/.zcash/ \
&& touch /home/$ZCASHD_USER/.zcash/zcash.conf
WORKDIR /srv/zcashd
RUN mkdir -p /srv/$ZCASHD_USER/.zcash/ \
&& touch /srv/$ZCASHD_USER/.zcash/zcash.conf
ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -3,6 +3,27 @@
set -ex
set -o pipefail
env | sort
zcash-fetch-params
ln -sf /dev/stderr .zcash/debug.log
touch .zcash/zcash.conf
export ZCASHD_CMD='zcashd -printtoconsole'
if [[ ! -z "${ZCASHD_NETWORK}" ]];then ZCASHD_CMD+=" -testnet -addnode=testnet.z.cash ";fi
if [[ ! -z "${ZCASHD_SHOWMETRICS}" ]];then ZCASHD_CMD+=" -showmetrics=1";fi
if [[ ! -z "${ZCASHD_LOGIPS}" ]];then ZCASHD_CMD+=" -logips=1";fi
if [[ ! -z "${ZCASHD_EXPERIMENTALFEATURES}" ]];then ZCASHD_CMD+=" -experimentalfeatures=1";fi
if [[ ! -z "${ZCASHD_GEN}" ]];then ZCASHD_CMD+=" -gen=1";fi
if [[ ! -z "${ZCASHD_ZSHIELDCOINBASE}" ]];then ZCASHD_CMD+=" -zshieldcoinbase=1";fi
if [[ ! -z "${ZCASHD_RPCUSER}" ]];then ZCASHD_CMD+=" -rpcuser=${ZCASHD_RPCUSER}";fi
if [[ ! -z "${ZCASHD_RPCPASSWORD}" ]];then ZCASHD_CMD+=" -rpcpassword=${ZCASHD_RPCPASSWORD}";fi
if [[ ! -z "${ZCASHD_RPCBIND}" ]];then ZCASHD_CMD+=" -rpcbind=${ZCASHD_RPCBIND}";fi
if [[ ! -z "${ZCASHD_ALLOWIP}" ]];then ZCASHD_CMD+=" -rpcallowip=${ZCASHD_ALLOWIP}";fi
if [[ "${ZCASHD_NETWORK}" == "testnet" ]];then
mkdir -p .zcash/testnet3
rm -f .zcash/testnet3/debug.log
fi
touch .zcash/zcash.conf
echo "Starting: ${ZCASHD_CMD}"
${ZCASHD_CMD}