3GLHIR4FVKUCN5EIXCJROC3RDN3Y7DHBU3KN3QBRDHST7VPIOOUAC
IR75ZMX32SFFMDNV2I2L22X5JTWCOC4UUBCSPU7S6VHR6HFV6ADQC
E2KOBKIJ2QMMC77UYNURGCTDGAIIRMBJNG7BMVLSFFPK5RAZ7KFAC
XZLSHL4DE6B5OEJVXALEYXY5JY2EJYUL2SSUJEGMNX65Y6JRJJUAC
LEINLS3X55PB6TSCNC5RVMDMV56XHTV4MNDUC42H7DDFMPDYUNTAC
GMYPBCWEB6NKURRILAHR3TJUKDOGR2ZMK5I6MS6P5G2LAGH36P3QC
NJNMO72S7VIUV22JXB4IFPZMHWTJAOTP6EC6Z4QSKYIROSXT52MQC
5SBSBFLSDRLVSWPBVP4SWOKNAXWIZL5YR646VFCBRUAG2C5QOGUQC
MJDIMD5BQEBC265AQAGYE2K6EHHS7ZMZY3I6WE5MCDSTA2E2VY7AC
apt-get update
apt-get install -y postgresql
apt-get install -y postgresql-contrib
apt-get install -y git
addgroup admin
adduser nuttycom admin
# docker setup
wget -qO- https://get.docker.com/ | sh
mkdir -p /opt/containers/aftok-server
chown -R root:docker /opt/containers
chmod -R g+ws /opt/containers
git clone git@github.com:nuttycom/aftok.git
cp aftok/conf/aftok.cfg.example /opt/containers/aftok-server/aftok.cfg
# postgres setup
sudo -u postgres createuser aftok -d -E -P
createdb -O aftok -h 127.0.0.1 -p 5432 -U aftok -W -E UTF8 aftok
sudo -u postgres psql -c 'create extension if not exists "uuid-ossp";' aftok
psql -h 127.0.0.1 -p 5432 -U aftok -W -f sql/aftok-pg.sql aftok
# get the aftok image from dockerhub
docker login
docker pull nuttycom/aftok:0.1
# start the snap application
docker run --name aftok-server -v /opt/containers/aftok-server:/etc/aftok:ro --net="host" -d nuttycom/aftok
# set up nginx
mkdir -p /opt/containers/aftok-nginx
cp aftok/deploy/nginx.conf /opt/containers/aftok-nginx
openssl req -x509 -newkey rsa:2048 -keyout /opt/containers/aftok-nginx/aftok.key -out /opt/containers/aftok-nginx/aftok.crt -days 365 -nodes
# run nginx under docker
docker run --name aftok-nginx -v /opt/containers/aftok-nginx:/etc/nginx:ro --net="host" -d nginx
version: "3.7"
services:
aftok:
image: aftok/aftok-server:latest
container_name: aftok-server
expose:
- "8000"
depends_on:
- aftokdb
- zcashd
volumes:
- type: bind
source: /opt/aftok/aftok-server
target: /etc/aftok
read_only: true
- type: bind
source: /opt/aftok/aftok-server-logs
target: /opt/aftok/log
networks:
- front-tier
- back-tier
init: true
aftok-client:
image: aftok/aftok-client:latest
container_name: aftok-client
entrypoint: /opt/aftok/aftok-client-cp.sh
volumes:
- type: volume
source: v_aftok-client
target: /opt/aftok/client/dist-volume
nginx:
image: nginx:latest
container_name: aftok-nginx
ports:
- "80:80"
- "443:443"
depends_on:
- aftok
volumes:
- type: bind
source: /opt/aftok/nginx-logs
target: /var/log/nginx
- type: bind
source: /opt/aftok/nginx
target: /etc/nginx
read_only: true
- type: bind
source: /opt/aftok/letsencrypt/etc/letsencrypt
target: /etc/letsencrypt
read_only: true
- type: bind
source: /opt/aftok/letsencrypt/data/letsencrypt
target: /opt/letsencrypt
read_only: true
- type: bind
source: /opt/aftok/static/aftok.com/
target: /opt/static/site
read_only: true
- type: volume
source: v_aftok-client
target: /opt/static/app
read_only: true
networks:
- front-tier
aftokdb:
image: postgres:latest
container_name: aftok-db
expose:
- "5432"
volumes:
- type: volume
source: aftok-data
target: /var/lib/postgresql/data
- type: bind
source: /opt/aftok/postgres/dumps
target: /opt/
read_only: true
networks:
- back-tier
zcashd:
image: electriccoinco/zcashd:v4.2.0
container_name: aftok-zcashd
expose:
- "8232"
ports:
- "8233:8233"
volumes:
- type: bind
source: /opt/aftok/zcashd/zcash-data
target: /srv/zcashd/.zcash
- type: bind
source: /opt/aftok/zcashd/zcash-params
target: /srv/zcashd/.zcash-params
read_only: true
networks:
- back-tier
volumes:
aftok-data:
v_aftok-client:
networks:
front-tier:
driver: bridge
back-tier:
#!/bin/bash
docker exec -it aftok-server ~/.local/bin/moo-postgresql upgrade --config-file /etc/aftok/aftok-migrations.cfg
# zcashd:
# image: electriccoinco/zcashd:v4.0.0
# container_name: aftok-zcashd
# expose:
# - "18232"
# ports:
# - "18233:18233"
# volumes:
# - type: bind
# source: ./local/zcashd/zcash-data
# target: /srv/zcashd/.zcash
# - type: bind
# source: ./local/zcashd/zcash-params
# target: /srv/zcashd/.zcash-params
# read_only: true
# networks:
# - back-tier
zcashd:
image: electriccoinco/zcashd:v4.0.0
container_name: aftok-zcashd
expose:
- "18232"
ports:
- "18233:18233"
volumes:
- type: bind
source: ./local/zcashd/zcash-data
target: /srv/zcashd/.zcash
- type: bind
source: ./local/zcashd/zcash-params
target: /srv/zcashd/.zcash-params
read_only: true
networks:
- back-tier