forked from Joystream/orion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
161 lines (156 loc) · 4.53 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
version: '3.4'
services:
# PostgerSQL database for Orion
orion-db:
image: postgres:14
container_name: orion-db
restart: unless-stopped
env_file:
- .env
environment:
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: ${DB_NAME}
ports:
- '127.0.0.1:${DB_PORT}:${DB_PORT}'
command: ['postgres', '-c', 'config_file=/etc/postgresql/postgresql.conf', '-p', '${DB_PORT}']
shm_size: 1g
volumes:
- orion-db-data:/var/lib/postgresql/data
- ./postgres.conf:/etc/postgresql/postgresql.conf
# Orion processor
orion-processor:
image: joystream/orion:latest
container_name: orion-processor
restart: unless-stopped
depends_on:
- orion-db
env_file:
- .env
environment:
- DB_HOST=orion-db
- GQL_PORT=${GRAPHQL_API_PORT}
volumes:
- ./db/export:/squid/db/export
command: >
sh -c "npx squid-typeorm-migration apply && \
node lib/processor.js"
ports:
- '127.0.0.1:${PROCESSOR_PROMETHEUS_PORT}:${PROCESSOR_PROMETHEUS_PORT}'
# Orion GraphQL API
orion-graphql-api:
container_name: orion-graphql-api
image: joystream/orion:latest
restart: unless-stopped
depends_on:
- orion-db
env_file:
- .env
environment:
- DB_HOST=orion-db
- GQL_PORT=${GRAPHQL_API_PORT}
command: ['npm', 'run', 'graphql-server-start']
ports:
- '127.0.0.1:${GRAPHQL_API_PORT}:${GRAPHQL_API_PORT}'
# Orion Authentication API
orion-auth-api:
container_name: orion-auth-api
image: joystream/orion:latest
restart: unless-stopped
depends_on:
- orion-db
env_file:
- .env
environment:
- DB_HOST=orion-db
command: ['npm', 'run', 'auth-server-start']
ports:
- '127.0.0.1:${AUTH_API_PORT}:${AUTH_API_PORT}'
# Caddy
orion-caddy:
profiles:
- deploy
container_name: orion-caddy
image: caddy:2.6
restart: unless-stopped
env_file:
- .env
ports:
- '80:80'
- '443:443'
- '443:443/udp'
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./atlas:/srv/atlas
- ./caddy/data:/data
- ./caddy/config:/config
archive_db:
container_name: orion_archive_db
hostname: orion_archive_db
image: postgres:14 # CockroachDB cluster might be a better fit for production deployment
restart: unless-stopped
volumes:
- orion_archive_db_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: squid-archive
ports:
- '127.0.0.1:${ARCHIVE_DB_PORT}:${ARCHIVE_DB_PORT}'
- '[::1]:${ARCHIVE_DB_PORT}:${ARCHIVE_DB_PORT}'
command: ['postgres', '-c', 'log_statement=all', '-p', '${ARCHIVE_DB_PORT}']
ingest:
container_name: orion_archive_ingest
depends_on:
- archive_db
restart: unless-stopped
image: subsquid/substrate-ingest:firesquid
command: [
'-e',
'${WS_SOURCE}',
'-c',
'20', # allow up to 20 pending requests for the above endpoint (default is 5)
# "--start-block", "1000000", # uncomment to specify a non-zero start block
'--out',
'postgres://postgres:postgres@orion_archive_db:${ARCHIVE_DB_PORT}/squid-archive',
]
gateway:
container_name: orion_archive_gateway
hostname: orion_archive_gateway
depends_on:
- archive_db
restart: unless-stopped
image: subsquid/substrate-gateway:firesquid
environment:
DATABASE_MAX_CONNECTIONS: 5
RUST_LOG: 'actix_web=info,actix_server=info'
command: [
'--database-url',
'postgres://postgres:postgres@orion_archive_db:${ARCHIVE_DB_PORT}/squid-archive',
# "--evm-support" # uncomment for chains with Frontier EVM pallet
# (e.g. Moonbeam/Moonriver or Astar/Shiden)
]
ports:
- '127.0.0.1:${GATEWAY_PORT}:8000'
- '[::1]:${GATEWAY_PORT}:8000'
# Explorer service is optional.
# It provides rich GraphQL API for querying archived data.
# Many developers find it very useful for exploration and debugging.
explorer:
container_name: orion_archive_explorer
hostname: orion_archive_explorer
restart: unless-stopped
image: subsquid/substrate-explorer:firesquid
environment:
DB_TYPE: postgres # set to `cockroach` for Cockroach DB
DB_HOST: archive_db
DB_PORT: '12345'
DB_NAME: 'squid-archive'
DB_USER: 'postgres'
DB_PASS: 'postgres'
ports:
- '${EXPLORER_PORT}:3000'
volumes:
orion_archive_db_data:
driver: local
orion-db-data:
driver: local