-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
204 lines (185 loc) · 6.96 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
# production docker-compose.yml,
# see docker-compose.override.yml for DEVELOPMENT
version: '3'
name: subledgr-stack
# PORTS, confirgured in .env
# - service:local port - PORT_PREFIX
# - 28080:8080 - nginx frontend - HTTP_PORT
# - 28080:8080 - vue3 frontend, http
# - /graphql proxy to graphql api
# - :4000 - graphql api, http - API_PORT
# - 23000:3000 - bullmq workers - BULLMQ_PORT
# - 23306:3306 - mariadb / default - DB_PORT
# - 25432:5432 - postgres / indexDb - INDEXDB_PORT
# - 26379:6379 - redis - REDIS_PORT
services:
subledgr-redis:
container_name: subledgr-redis
image: redis
platform: ${TARGETPLATFORM:-linux/amd64} # see .env
restart: unless-stopped
ports:
- "${SUBLEDGR_PORT_PREFIX}${SUBLEDGR_REDIS_PORT:-6379}:6379"
subledgr-datastore:
container_name: subledgr-datastore
image: mariadb:10.4
platform: ${TARGETPLATFORM:-linux/amd64} # see .env
restart: unless-stopped
# build: nothing to build
environment:
MARIADB_ROOT_PASSWORD: ${SUBLEDGR_MARIADB_ROOT_PASSWORD:-thisIsASecret} # see .env
MYSQL_ROOT_PASSWORD: ${SUBLEDGR_MARIADB_ROOT_PASSWORD} # see .env
PGDATA: /data/postgres # see volumes below
ports:
- "${SUBLEDGR_PORT_PREFIX}${SUBLEDGR_DB_PORT:-3306}:3306"
volumes:
- ${SUBLEDGR_MARIADB_DATA:-./data}/mariadb:/var/lib/mysql:Z
- ${SUBLEDGR_MARIADB_DATA:-./data}/schema.pgsql.sql:/docker-entrypoint-initdb.d/schema.sql:ro
# - /mnt/Docker/subledgr/data/postgres:/data/postgres
# - /mnt/Docker/subledgr/data/schema.pgsql.sql:/docker-entrypoint-initdb.d/schema.sql:ro
# subledgr-datastore:
# container_name: subledgr-datastore
# image: postgres:15.2-alpine
# # build: nothing to build
# restart: unless-stopped
# environment:
# POSTGRES_PASSWORD: ${SUBLEDGR_POSTGRES_PASSWORD} # see .env
# PGDATA: /data/postgres # see volumes below
# ports:
# - "25432:5432"
# volumes:
# - ${SUBLEDGR_PG_DATA:-/mnt/Docker/subledgr/data}/postgres:/data/postgres
# - ${SUBLEDGR_PG_DATA:-/mnt/Docker/subledgr/data}/schema.pgsql.sql:/docker-entrypoint-initdb.d/schema.sql:ro
# # - /mnt/Docker/subledgr/data/postgres:/data/postgres
# # - /mnt/Docker/subledgr/data/schema.pgsql.sql:/docker-entrypoint-initdb.d/schema.sql:ro
# this is currently running on 192.168.10.106...
# subledgr-indexDb:
# container_name: subledgr-indexDb
# image: postgres:15.2-alpine
# restart: unless-stopped
# # environment:
# ports:
# - "25432:5432"
# DOTSAMA REST API
# we should run our own, but for now, use the public one
# GraphQL API
subledgr-api:
container_name: subledgr-api
image: docker.metaspan.io/subledgr/subledgr-api
platform: ${TARGETPLATFORM:-linux/amd64} # see .env
restart: unless-stopped
build:
context: ../
dockerfile: docker/Dockerfile.api
args:
- TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} # see .env
ports:
- "${SUBLEDGR_PORT_PREFIX}${SUBLEDGR_GRAPHQL_PORT:-4000}:4000"
environment:
SUBLEDGR_DB_HOST: ${SUBLEDGR_DB_HOST}
SUBLEDGR_DB_DATABASE: ${SUBLEDGR_DB_DATABASE:-subledgr}
SUBLEDGR_DB_USER: ${SUBLEDGR_DB_USER:-subledgr}
SUBLEDGR_DB_PASSWORD: ${SUBLEDGR_DB_PASSWORD:-subledgr}
SUBLEDGR_DB_PORT: ${SUBLEDGR_DB_PORT:-3306}
SUBLEDGR_DB_DIALECT: ${SUBLEDGR_DB_DIALECT:-mariadb}
SUBLEDGR_DB_LOGGING: ${SUBLEDGR_DB_LOGGING:-false}
# subledgr index db
SUBLEDGR_INDEXDB_HOST: ${SUBLEDGR_INDEXDB_HOST:-192.168.1.106}
SUBLEDGR_INDEXDB_DATABASE: ${SUBLEDGR_INDEXDB_DATABASE:-subledgr_subsquid}
SUBLEDGR_INDEXDB_USER: ${SUBLEDGR_INDEXDB_USER:-subledgr_subsquid}
SUBLEDGR_INDEXDB_PASSWORD: ${SUBLEDGR_INDEXDB_PASSWORD:-subledgr_subsquid}
SUBLEDGR_INDEXDB_PORT: ${SUBLEDGR_INDEXDB_PORT:-5432}
SUBLEDGR_INDEXDB_DIALECT: ${SUBLEDGR_INDEXDB_DIALECT:-postgres}
COINBASE_API_KEY: ${COINBASE_API_KEY}
COINBASE_API_SECRET: ${COINBASE_API_SECRET}
SUBSCAN_API_KEY: ${SUBSCAN_API_KEY}
SUBLEDGR_JWT_SECRET_KEY: ${SUBLEDGR_JWT_SECRET_KEY}
#SUBLEDGR_GRAPHQL_JWT_SECRET_KEY: ${SUBLEDGR_GRAPHQL_JWT_SECRET_KEY}
SUBLEDGR_GRAPHQL_PORT: ${SUBLEDGR_GRAPHQL_PORT:-4000}
DOTSAMA_REST_API_BASE_URL: ${DOTSAMA_REST_API_BASE_URL:-https://api.metaspan.io/api}
SUBLEDGR_APP_BASEURL: ${SUBLEDGR_APP_BASEURL:-https://app.subledgr.com}
NODEMAILER_HOST: ${NODEMAILER_HOST}
NODEMAILER_PORT: ${NODEMAILER_PORT}
NODEMAILER_SECURE: ${NODEMAILER_SECURE:-false}
NODEMAILER_USER: ${NODEMAILER_USER}
NODEMAILER_PASS: ${NODEMAILER_PASS}
depends_on:
- subledgr-datastore
# - subledgr-indexDb
# BullMQ workers
subledgr-workers:
container_name: subledgr-workers
image: docker.metaspan.io/subledgr/subledgr-workers
restart: unless-stopped
build:
context: ../
dockerfile: docker/Dockerfile.workers
args:
- TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
depends_on:
- subledgr-redis
- subledgr-datastore
ports:
- '${SUBLEDGR_PORT_PREFIX}${SUBLEDGR_BULLMQ_PORT:-3000}:3000'
command: ["node", "workers.js"]
# frontend - nginx with static vue3 files and proxy to /api
subledgr-frontend:
container_name: subledgr-frontend
image: docker.metaspan.io/subledgr/subledgr-fe
restart: unless-stopped
build:
context: ../
dockerfile: docker/Dockerfile.frontend
args:
- TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} # see .env
ports:
- "${SUBLEDGR_PORT_PREFIX}${SUBLEDGR_HTTP_PORT:-8080}:8080"
# volumes:
# - ../static:/usr/share/nginx/html
depends_on:
- subledgr-api
environment:
- SERVER_NAME=alpha.subledgr.com
#- HTTP_PORT=8080 # nginx must listen on 8080
- API_HOST=subledgr-api
- API_PORT=4000
# proxy the /api ?
# subledgr-proxy:
# # image: nginx
# image: subledgr/nginx:latest
# build:
# context: ./nginx
# dockerfile: Dockerfile
# ports:
# - 8081:8080
subledgr-www:
container_name: subledgr-www
image: docker.metaspan.io/subledgr/subledgr-www
restart: unless-stopped
build:
context: ../
dockerfile: docker/Dockerfile.www
args:
- TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} # see .env
ports:
- "${SUBLEDGR_PORT_PREFIX}${SUBLEDGR_WWW_PORT:-8081}:8080"
# depends_on:
# - subledgr-api
environment:
- SERVER_NAME=subledgr.com
subledgr-docs:
container_name: subledgr-docs
image: docker.metaspan.io/subledgr/subledgr-docs
restart: unless-stopped
build:
context: ../
dockerfile: docker/Dockerfile.docs
args:
- TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} # see .env
ports:
- "${SUBLEDGR_PORT_PREFIX}${SUBLEDGR_DOCS_HTTP_PORT:-8082}:8080"
# depends_on:
# - subledgr-api
# environment:
# - SUBLEDGR_DOCS_HTTP_PORT=${SUBLEDGR_DOCS_HTTP_PORT:-8082}
# - SUBLEDGR_DOCS_SERVER_NAME=docs.subledgr.com