This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
137 lines (128 loc) · 4.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
version: '3.2'
# Docker Services breakdown:
# db - mysql DB, used by backend
# redis - KV store, used by laravel queues
# nginx - webserver the backend, uses fpm as a backing
# fpm - is called by nginx to actually execute the php for the backendd
# frontend - runs React in dev mode with hot reloading
# ethereum_proxy - glang gRPC server, is called by the backend, handles talking to eth network
# truffle_test - ephemeral container that runs the truffle (contract) tests
# eth_rpc - container that runs the ganache CLI, truffle_test uses this as a local eth node
# codegen_tools_proto - ephemeral, generates the golang + php stubs based on RpcServer.proto
# codegen_tools_abigen - ephemeral, generates the golang stubs based on solidity
# codegen_tools_abigen_js - ephemeral, generates the js ABI for React to consume based on solidity
# laravel_queue_worker - supervisord process that runs laravel queues
# laravel_cron_worker - supervisord process that runs laravel scheduler on cron
services:
db:
image: mysql:5.7
volumes:
- "./.data/db:/var/lib/mysql"
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: cryptocards
ports:
- "3307:3306" #expose 3306 on a nonstandard port so that it doesn't conflict with mysql on the host
redis:
image: redis:latest
ports:
- "6379:6379"
nginx:
image: nginx:latest
ports:
- "8728:8080"
volumes:
- ./backend:/var/www/laravel
working_dir: /var/www/laravel
links:
- fpm
volumes:
- ./backend/vhost-docker.conf:/etc/nginx/conf.d/laravel.conf
laravel_queue_worker:
env_file: ./backend/.env.docker
build: ./tools/php-queue-worker
volumes:
- ./backend/:/var/www/laravel
links:
- db
- redis
- ethereum_proxy
laravel_cron_worker:
env_file: ./backend/.env.docker
build: ./tools/php-cron-worker
volumes:
- ./backend/:/var/www/laravel
links:
- db
- redis
- ethereum_proxy
fpm:
build: ./backend
ports:
- "9000:9000"
links:
- db
- redis
- ethereum_proxy
volumes:
- ./backend/:/var/www/laravel
working_dir: /var/www/laravel
env_file: ./backend/.env.docker
frontend:
build: ./frontend
volumes:
- { type: bind, source: ./frontend, target: /app }
environment:
REACT_APP_API_BASE_URL: http://localhost:8728/v1
REACT_APP_SITE_URL: http://localhost:5000
PORT: 3000
ports:
- "5000:3000" #expose 3000 via 5000
- "35729:35729" #for hot reloading
ethereum_proxy:
build: ./ethereum_proxy
volumes:
- { type: bind, source: ./ethereum_proxy, target: /ethereum_proxy }
environment:
PORT: 50051
RPC_HOST: eth_rpc
RPC_PORT: 8545
#this keypair is ganache-cli deterministic mode account #1
ADMIN_PUBKEY: "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1"
ADMIN_PRIVKEY: "4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"
links:
- eth_rpc
truffle_test:
build: ./eth_contracts
volumes:
- ./eth_contracts:/app
environment:
RPC_HOST: eth_rpc
RPC_PORT: 8545
links:
- eth_rpc
- nginx
eth_rpc:
image: nicky/ganache-cli
command: --deterministic --networkId 999999
ports:
- "8545:8545"
codegen_tools_proto:
build: ./tools/proto
volumes:
- { type: bind, source: ./backend, target: /backend }
- { type: bind, source: ./ethereum_proxy, target: /ethereum_proxy }
- { type: bind, source: ./tools, target: /tools }
codegen_tools_abigen:
build: ./tools/abigen
volumes:
- { type: bind, source: ./eth_contracts, target: /eth_contracts}
- { type: bind, source: ./ethereum_proxy, target: /ethereum_proxy }
- { type: bind, source: ./tools, target: /tools }
codegen_tools_abigen_js:
build: ./tools/abigen_js
volumes:
- { type: bind, source: ./eth_contracts, target: /eth_contracts}
- { type: bind, source: ./frontend, target: /frontend }
- { type: bind, source: ./tools, target: /tools }