-
Notifications
You must be signed in to change notification settings - Fork 26
/
docker-compose.yml
213 lines (211 loc) · 4.98 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
version: "3"
services:
sqs:
build:
context: ./local_queue
volumes:
- ./local_queue/elasticmq.conf:/elasticmq.conf
ports:
- 9324:9324
db:
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_DB: bounties
volumes:
- psql_bounties:/var/lib/postgresql/data
ports:
- "5432:5432"
redis:
image: "redis"
volumes:
- redis_bounties:/data
ports:
- "6379:6379"
bounties_api:
build:
context: ./bounties_api
dockerfile: Dockerfile
restart: always
env_file:
- .env
command: bash -c "python3 manage.py makemigrations && python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:83"
volumes:
- ./bounties_api:/code
ports:
- "8000:83"
depends_on:
- db
- redis
bounties_subscriber:
build:
context: ./bounties_api
dockerfile: Dockerfile
restart: always
env_file:
- .env
command: bash -c "sleep 5 && python3 manage.py makemigrations && python3 manage.py migrate && python3 manage.py bounties_subscriber"
volumes:
- ./bounties_api:/code
depends_on:
- sqs
- db
- redis
- bounties_api
sql_jobs:
# In production, these run an as an hourly cronjob.
# Here, we use a local.sh to just run it more often
build:
context: ./sql_jobs
dockerfile: Dockerfile
command: bash -c "./local.sh"
env_file:
- .env
volumes:
- ./sql_jobs:/usr/src/app
blacklist:
# In production, these run an as an hourly cronjob.
# Here, we use a local.sh to just run it more often
build:
context: ./bounties_api
dockerfile: Dockerfile
command: bash -c "./localBlacklist.sh"
env_file:
- .env
volumes:
- ./bounties_api:/code
depends_on:
- sqs
- db
- redis
- bounties_api
track_bounty_expirations:
# TODO - just make this a cronjob. It does not need to be a long-running job
build:
context: ./bounties_api
dockerfile: Dockerfile
restart: always
env_file:
- .env
command: python3 manage.py track_bounty_expirations
volumes:
- ./bounties_api:/code
depends_on:
- db
- bounties_api
get_token_values:
# In production, these run an as an every 5 minute cronjob.
# Here, we use a local.sh to just put it in a bash loop
build:
context: ./bounties_api
dockerfile: Dockerfile
restart: always
env_file:
- .env
command: bash -c "./local.sh"
volumes:
- ./bounties_api:/code
depends_on:
- db
- bounties_api
# contract_subscriber:
# build:
# context: ./contract_subscriber
# restart: always
# env_file:
# - .env
# command: npm start
# volumes:
# - ./contract_subscriber:/usr/src/app
# - /usr/src/app/node_modules
# depends_on:
# - sqs
# - redis
contract_subscriber_v1:
build:
context: ./contract_subscriber
restart: always
env_file:
- .env
environment:
contract_version: v1
command: npm start
volumes:
- ./contract_subscriber:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- sqs
- redis
contract_subscriber_v2:
build:
context: ./contract_subscriber
restart: always
env_file:
- .env
environment:
contract_version: v2
command: npm start
volumes:
- ./contract_subscriber:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- sqs
- redis
contract_subscriber_v2-1:
build:
context: ./contract_subscriber
restart: always
env_file:
- .env
environment:
contract_version: v2.1
command: npm start
volumes:
- ./contract_subscriber:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- sqs
- redis
contract_subscriber_v2-2:
build:
context: ./contract_subscriber
restart: always
env_file:
- .env
environment:
contract_version: v2.2
command: npm start
volumes:
- ./contract_subscriber:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- sqs
- redis
graphql-engine:
image: hasura/graphql-engine:v1.0.0-beta.6.cli-migrations
volumes:
- ./graphql/hasura/migrations:/hasura-migrations
depends_on:
- sqs
- db
- redis
- bounties_api
links:
- "db:db"
ports:
- "8080:8080"
restart: always
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@db:5432/bounties
HASURA_GRAPHQL_ENABLE_CONSOLE: "false" # set to "false" to disable console
HASURA_GRAPHQL_CORS_DOMAIN: "*"
HASURA_GRAPHQL_ACCESS_KEY: "secret"
HASURA_GRAPHQL_JWT_SECRET: '{ "type":"HS256", "key": "dnf5mn4NmYhqO8eaxU5RZy3yC9ogzHSKO4iTWuubqUnJyAzjEbRPzH9KCf2w3p5cu0exQ9TV1LVuXv-yOf8" }'
# env_file:
# - event-triggers.env
# - remote-schemas.env
volumes:
psql_bounties:
external: true
redis_bounties:
external: true