-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
105 lines (99 loc) · 3.08 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
version: '2.4'
services:
db:
image: postgres
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: c21u_admin_cert_access
POSTGRES_DB: certs
labels:
- "traefik.tcp.services.postgres.loadbalancer.server.port=5432"
- "traefik.tcp.routers.postgres.rule=HostSNI(`*`)"
- "traefik.tcp.routers.postgres.entrypoints=postgres"
- "traefik.tcp.routers.postgres.service=postgres"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin -d certs"]
interval: 10s
timeout: 5s
retries: 5
web:
build: .
command: sh /code/run.sh
environment:
DB_ENGINE: django.db.backends.postgresql
DB_HOST: db
DB_USER: admin
DB_NAME: certs
DB_PASSWORD: c21u_admin_cert_access
DEBUG: "True"
MANDRILL_API_KEY: $MANDRILL_API_KEY
SENDGRID_API_KEY: $SENDGRID_API_KEY
ALLOWED_HOSTNAME: admin.127.0.0.1.xip.io
CAS_SERVER_URL: https://casserver.herokuapp.com/cas/
USE_X_FORWARDED_HOST: "True"
labels:
- "traefik.http.routers.bcadmin.rule=Host(`admin.127.0.0.1.xip.io`)"
- "traefik.http.routers.bcadmin.tls=true"
volumes:
- .:/code
expose:
- "8000"
depends_on:
db:
condition: service_healthy
reverse-proxy:
image: traefik:v2.0
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- $HOME/certs:/data/traefik:ro
- ./traefik:/etc/traefik:ro
bitcoind:
image: seegno/bitcoind:0.13-alpine
environment:
PRIVKEY: cUiqhQJ4SKmwsCGVA6sJqGiFYifyhXbk3nu7Wv8eQxfVR1kZ3u8D
ISSUER: myTiVfMp9ygfQSmpKf9WUrTAewz8ebqMsr
BTC_CLI: bitcoin-cli -regtest -rpcpassword=makeitrain
command: |
/bin/ash -c "until $$BTC_CLI importprivkey $$PRIVKEY 2>/dev/null && if [ \"$$($$BTC_CLI getblockcount)\" -lt 100 ]; then $$BTC_CLI generate 101 && $$BTC_CLI sendtoaddress $$ISSUER 49; fi
do
sleep 2
done &
bitcoind -printtoconsole -regtest=1 -rpcpassword=makeitrain -rpcallowip=172.22.0.0/16"
networks:
- bc
cert-issuer:
image: stuartfreeman/blockcerts-issuer
environment:
PRIVKEY: cUiqhQJ4SKmwsCGVA6sJqGiFYifyhXbk3nu7Wv8eQxfVR1kZ3u8D
ISSUING_ADDRESS: myTiVfMp9ygfQSmpKf9WUrTAewz8ebqMsr
USB_NAME: /etc/cert-issuer/
KEY_FILE: pk_issuer.txt
NO_SAFE_MODE: "True"
CHAIN: bitcoin_regtest
BITCOIND: "True"
command: /bin/bash -c "mkdir -p ~/.bitcoin; echo $$PRIVKEY > $$USB_NAME/$$KEY_FILE && echo -e rpcpassword=makeitrain\\\\nrpcconnect=blockcerts-admin-app_bitcoind_1\\\\nrpcport=18332 > ~/.bitcoin/bitcoin.conf && /start.sh"
labels:
- "traefik.http.routers.certissuer.rule=Host(`cert-issuer.127.0.0.1.xip.io`)"
- "traefik.http.routers.certissuer.tls=true"
expose:
- 80
networks:
- default
- bc
depends_on:
- bitcoind
volumes:
postgres_data:
networks:
bc:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.22.0.0/16