./priv/roles/Backend.sh in stacco-0.1.21 vs ./priv/roles/Backend.sh in stacco-0.1.22

- old
+ new

@@ -1,10 +1,9 @@ # DockerHost tools run-gist "tsutsu/72c4ac40591f96ad379f" +docker-bootstrap -mkdir -p /var/lib/docker && mount /dev/xvdc /var/lib/docker -mkdir -p /volumes && mount /dev/xvdd /volumes # create bexng file-based config mkdir -p /etc/bexng echo "${DOMAIN}" > /etc/bexng/name cat >"/etc/bexng/secrets.exs" <<EOF @@ -24,30 +23,37 @@ ] ] EOF -docker-bootstrap +docker-define-service "bexio/postgresql" -docker-define-service "quay.io/bexio/postgresql" \ - --volume "/volumes/postgresql:/var/lib/postgresql" - -docker-define-service "quay.io/bexio/bitcoind" \ +docker-define-service "bexio/bitcoind" \ --volume "/volumes/bitcoind:/var/lib/bitcoin" -docker-define-service "quay.io/bexio/bexng" \ +cat >/usr/local/sbin/bexng-before-start <<EOF +docker run --rm \ + \$(docker-container-links-for -w 'postgresql') \ + 'bexio/postgresql:latest' \ + db:create 'bexng' +EOF +chmod a+x /usr/local/sbin/bexng-before-start + +docker-define-service "bexio/bexng" \ --dependency "bitcoind" \ --dependency "postgresql" \ + --before-start "/usr/local/sbin/bexng-before-start" \ --volume "/etc/bexng:/target" \ - --publish="51607:51607" \ - -e "BEXNG_TARGET_SYSTEM=${DOMAIN}" + --publish="51607:51607" -docker-define-service "quay.io/bexio/bexng_frontend" \ +docker-define-service "bexio/bexng-frontend" \ --dependency "bexng" \ --publish="80:8080" + + echo "starting docker-container services..." start postgresql start bitcoind start bexng -start bexng_frontend +start bexng-frontend