Improve documentation of local docker-compose setup.
[?]
Oct 4, 2020, 5:28 PM
MJDIMD5BQEBC265AQAGYE2K6EHHS7ZMZY3I6WE5MCDSTA2E2VY7ACDependencies
- [2]
3KPGZUJ2Sendgrid supports port 587, which Comcast does not block. - [3]
NJNMO72SAdd zcash.com submodule and update client to modern halogen. - [4]
EPOYLP7OA little .gitignore cleanup. - [5]
GMYPBCWEMake docker-compose work. - [6]
OBFPJS2GProject successfully builds and tests under nix. - [7]
6L5BK5EHUse generic SMTP rather than Sendmail-specific mail client. - [8]
QO4NFWIYAdded sample config file. - [9]
5FLAK3MEFix nginx mime types. - [10]
XZLSHL4DThe server is now (tenuously) running, and serving pages via SSL! - [11]
PGZJ736CUpdate aftok.cfg.example and revise INSTALL instructions - [12]
4U7F3CPITHE GREAT RENAMING OF THINGS! - [13]
3TAMXHCZAdd migrations to server startup. - [14]
M3KUPGZKAdd invitation email template. - [*]
4ZLEDBK7Initial attempts at dockerizing, cabal isn't cooperating. - [*]
4B66XH43Add sample billing config - [*]
NSRSSSTRUpdate nginx.conf, make aftok host configurable for cli scripts.
Change contents
- edit in DEVELOPMENT.md at line 15
The easiest way to run local aftok infrastructure is using Docker anddocker-compose. Several steps are necessary to set up your local environmentfor development.Obtaining Docker Images-----------------------The docker-compose setup requires 4 images:* `aftok/aftok-server:latest`* `nginx/nginx:latest`* `postgres/postgres:9.4`* `electriccoinco/zcashd:v4.0.0`You can obtain these images by running the following. This assumes the use of`sudo` under Linux; this may not be necessary on other platforms (e.g. OSX).~~~bashmake build-image # build the aftok-server image(s)docker pull nginx/nginx:latesdocker pull postgres/postgres:9.4docker pull electriccoinco/zcashd:v4.0.0~~~If you have problems building the aftok-server image, you can also obtaina prebuilt image by running~~~bashdocker pull aftok/aftok-server:latest~~~Configuration Files-------------------A number of configuration files are required for docker-compose to be ableto run all of the necessary containers successfully. You should createa `local` directory, which will have the following contents:~~~local├── conf│ ├── nginx│ │ ├── mime.types│ │ └── nginx.conf│ ├── nginx-certs│ │ ├── aftok.crt│ │ └── aftok.key│ ├── server│ │ ├── aftok.bip70-chain.cert.pem│ │ ├── aftok.bip70.key.pem│ │ ├── aftok.cfg│ │ ├── aftok-migrations.cfg│ │ └── snap-site-key│ └── zcashd│ ├── zcash-data│ │ └── zcash.conf│ └── zcash-params└── db-dumps└── aftok.sample.plsql~~~Sample default versions of each of these files can be found in the `conf`directory; you can simply use the following to set up your local environment: - edit in DEVELOPMENT.md at line 80
~~~bashmkdir localcp -r conf local# The aftok-zcashd container runs zcashd as user 2001, so we change the# owner of the zcashd configuration directories to this user.sudo chown -R 2001.2001 local/conf/zcashd~~~Database Initialization----------------------- - edit in Dockerfile at line 50
RUN apt-get install -y --no-install-recommends pkg-config - file addition: daemon[4.54]
- file move: aftok-payouts.cfg.example → aftok-daemon.cfg
- file addition: nginx[4.54]
- file move: mime.types → mime.types
- file move: nginx.conf → nginx.conf
- file addition: server[4.54]
- file move: aftok-migrations.cfg.example → aftok-migrations.cfg
- file move: aftok.cfg.example → aftok.cfg
- replacement in conf/server/aftok.cfg at line 6
host = "127.0.0.1"host = "aftok-db" - replacement in conf/server/aftok.cfg at line 27
smtpUser = "whoareyou"smtpPass = "iami"smtpUser = "your_sendgrid_username"smtpKey = "your_sendgrid_key" - edit in conf/server/aftok.cfg at line 32
# Signing key for BIP-70 payment requests - edit in conf/server/aftok.cfg at line 39[4.355]
recaptchaSecret = "your_secret_goes_here"zcashd {zcashdHost = "aftok-zcashd"zcashdPort = 8232} - file addition: zcashd[4.54]
- file addition: zcash-data[0.2743]
- file addition: zcash.conf[0.2763]
testnet=1addnode=testnet.z.cash - edit in docker-compose.yml at line 11
- zcashd - replacement in docker-compose.yml at line 31
source: ./deploy/nginx/source: ./local/conf/nginx/ - edit in docker-compose.yml at line 63[18.521][4.24689]
networks:- back-tierzcashd:image: electriccoinco/zcashd:v4.0.0container_name: aftok-zcashdports:- "8232:8232"volumes:- type: bindsource: ./local/conf/zcashd/zcash-datatarget: /srv/zcashd/.zcash- type: bindsource: ./local/conf/zcashd/zcash-paramstarget: /srv/zcashd/.zcash-params