forked from Clay-Ferguson/quantizr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdc-distro_quanta.yaml
238 lines (202 loc) · 7.76 KB
/
dc-distro_quanta.yaml
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
version: '3.7'
services:
redis-distro:
image: redis:6.0
restart: always
hostname: redis-host-distro
networks:
bridge:
aliases:
- redis-host-distro
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
# Saves to disk every 20 seconds (if 1 or more writes done)
# command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
command: redis-server --port ${REDIS_PORT} --loglevel warning --requirepass ${REDIS_PASSWORD}
environment:
REDIS_HOST: "${REDIS_HOST}"
REDIS_PORT: "${REDIS_PORT}"
REDIS_PASSWORD: ${REDIS_PASSWORD}
# todo-a: start using a cache folder
# volumes:
# - cache:/data
mongo-distro:
hostname: mongo-host-distro
networks:
bridge:
aliases:
- mongo-host-distro
# WARNING: volumes will not handle '~' character for home folder. Do not use.
volumes:
- '${MONGO_DATA}:/data/db'
- '${MONGOD_CONF}:/etc/mongod.conf'
command: mongod --config /etc/mongod.conf
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: ${mongoPassword}
# Always specify version of mongo. When it upgrades automatically there can be database issues that need to be resolved
# and we don't want that happening unexpectedly
image: mongo:4.0
# I'm Disabling IPFS for now, because it always just runs for a while and then just mysteriously terminates.
# Need to investigate asap (todo-1)
# ipfs-distro:
# # https://hub.docker.com/r/ipfs/kubo/
# image: ipfs/kubo:release
# hostname: ipfs-host-distro
# networks:
# bridge:
# aliases:
# - ipfs-host-distro
# deploy:
# resources:
# limits:
# # cpus is a percentage of total power: 1.0==100%
# cpus: "0.1"
# memory: 512M
# # reservations:
# # cpus: 0.25
# # memory: 128M
# environment:
# # IPFS_PROFILE options (lowpower | server)
# IPFS_PROFILE: "server"
# IPFS_PATH: "/data/ipfs"
# volumes:
# - '${ipfs_staging}:/export'
# - '${ipfs_data}:/data/ipfs'
# ports:
# # Allow this thru your firewall: sudo ufw allow 4001
# - "4001:4001"
# - "4001:4001/udp"
quanta-distro:
image: ${DOCKER_IMAGE}
build:
context: .
args:
PORT_SEC: "${PORT_SEC}"
PORT: "${PORT}"
PORT_DEBUG: "${PORT_DEBUG}"
JAR_FILE: "${JAR_FILE}"
XMS: "${XMS}"
XMX: "${XMX}"
REDIS_HOST: "${REDIS_HOST}"
REDIS_PORT: "${REDIS_PORT}"
REDIS_PASSWORD: "${REDIS_PASSWORD}"
dockerfile: ./dockerfile-distro
restart: "no"
deploy:
restart_policy:
condition: none
max_attempts: 0
replicas: 1
hostname: quanta-host
networks:
bridge:
aliases:
- quanta-host
volumes:
- '${DATA_FOLDER}/docs:/docs'
- '${DATA_FOLDER}/tmp:/tmp'
- '${DATA_FOLDER}/log:/log'
- '${DEPLOY_TARGET}/config:/config'
- '/etc/letsencrypt/live/${quanta_domain}:/letsencrypt'
ports:
- '${HOST_PORT_SEC}:${PORT_SEC}'
- '${HOST_PORT}:${PORT}'
- '8000:8000'
environment:
# Docker warm vars
X_NODE_ID: "{{.Node.ID}}"
X_NODE_HOSTNAME: '{{.Node.Hostname}}'
X_SERVICE_ID: '{{.Service.ID}}'
X_SERVICE_NAME: '{{.Service.Name}}'
X_TASK_SLOT: "{{.Task.Slot}}"
X_TASK_ID: '{{.Task.ID}}'
X_TASK_NAME: '{{.Task.Name}}'
logging.config: /log/logback.xml
XMS: "${XMS}"
XMX: "${XMX}"
REDIS_HOST: "${REDIS_HOST}"
REDIS_PORT: "${REDIS_PORT}"
REDIS_PASSWORD: "${REDIS_PASSWORD}"
adminPassword: "${adminPassword}"
mongoPassword: "${mongoPassword}"
mongoSecurity: "true"
# WARNING: Most browsers (other than Firefox) will not support crypto unless you're on HTTPS
requireCrypto: "true"
# NOTE: '>-' removes all newline characters and makes one long string
# Using '|' there instead would preserve the newlines after read in
# The '-' after either of those removes any trailing newline
testUserAccounts: >-
FollowBot:${adminPassword}:${devEmail},
adam:${testPassword}:${devEmail},
bob:${testPassword}:${devEmail},
cory:${testPassword}:${devEmail},
dan:${testPassword}:${devEmail},
eric:${testPassword}:${devEmail}
nostrCurationAccounts: >-
admin,
clay
throttleTime: "0"
spring.config.location: "classpath:/application.properties"
mongodb.host: "${MONGO_HOST}"
mongodb.port: "${MONGO_PORT}"
instanceId: "prod"
profileName: "prod"
server.port: "${PORT_SEC}"
httpProtocol: "https"
metaHost: "${quanta_domain}"
allowFileSystemSearch: "false"
actPubEnabled: "true"
# tserver-tag
nostrDaemonEnabled: "${nostrDaemonEnabled}"
ipfsEnabled: "${ipfsEnabled}"
spring.http.multipart.max-file-size: "200MB"
spring.http.multipart.max-request-size: "200MB"
spring.servlet.multipart.max-file-size: "200MB"
spring.servlet.multipart.max-request-size: "200MB"
adminDataFolder: "/tmp"
# tserver-tag
TSERVER_PORT: "${TSERVER_PORT}"
TSERVER_API_KEY: "${TSERVER_API_KEY}"
# Uncomment for debugging... (don't forget to open ufw firewall for port on server)
JAVA_TOOL_OPTIONS: "-agentlib:jdwp=transport=dt_socket,address=0.0.0.0:8000,server=y,suspend=n"
ipfs.host: "http://ipfs-host-distro"
ipfs.apiPort: "5001"
ipfs.gatewayPort: "8080"
security.require-ssl: "true"
server.ssl.key-store: "/letsencrypt/keystore.p12"
server.ssl.key-store-password: "${prodKeyStorePassword}"
server.ssl.keyStoreType: "PKCS12"
server.ssl.keyAlias: "tomcat"
mail.port: ""
mail.user: "postmaster@quantizr.com"
mail.password: "${emailPassword}"
mail.host: "smtp.mailgun.org"
mail.from: "admin@quanta.wiki"
depends_on:
- mongo-distro
- redis-distro
# - ipfs-distro
# tserver-tag
tserver-distro:
image: ${TSERVER_IMAGE}
build:
context: ./src/main/resources/server
dockerfile: ./dockerfile
hostname: tserver-host
networks:
bridge:
aliases:
- tserver-host
volumes:
- "${DATA_FOLDER}/log:/home/node/app/log"
ports:
- "${TSERVER_PORT}:${TSERVER_PORT}"
environment:
TSERVER_PORT: "${TSERVER_PORT}"
TSERVER_API_KEY: "${TSERVER_API_KEY}"
depends_on:
- mongo-distro
# - ipfs-distro
networks:
bridge: