-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
205 lines (196 loc) · 5.61 KB
/
docker-compose.prod.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
version: "3.0"
services:
moilerplate:
build:
context: .
dockerfile: Dockerfile.prod
container_name: moilerplate-app
image: moilerplate-app
restart: always
environment:
- SERVER_HOST=0.0.0.0
- SERVER_PORT=8082
- LOG_PATH=logs/log.txt
- DEFAULT_ROWS_PER_PAGE=25
# DB
- DB_HOST=moilerplate_pg
- DB_PORT=5432
- DB_NAME=moilerplate
- DB_USER=postgres
- DB_PASSWORD=verystrongpassword
- DB_MAX_POOL_SIZE=5
- DB_MAX_OPEN_CONN=5
- DB_MAX_CONN_LIFETIME=1m
# Rate Limitting
- RATER_LIMIT=5
- BURST_LIMIT=5
- RATER_EVALUATION_INTERVAL=30s
- RATER_DELETION_TIME=1m
# Doorkeeper General
- DOORKEEPER_GENERAL_HASH_METHOD=SHA384
# Doorkeeper JWT
- DOORKEEPER_JWT_ISSUER=SUN_REC
- DOORKEEPER_JWT_SIGNING_METHOD=HMAC
- DOORKEEPER_JWT_SIGN_SIZE=256
- DOORKEEPER_JWT_PUB_KEY=jnvajiqjnrnjifji32jav923jvuhiah
- DOORKEEPER_JWT_PRIV_KEY=jnvajiqjnrnjifji32jav923jvuhiah
# If you choose HMAC, please fill both jwt priv and pub key with your secret key
- DOORKEEPER_JWT_ACCESS_TOKEN_DURATION=1h
- DOORKEEPER_JWT_REFRESH_TOKEN_DURATION=24h
# Doorkeeper Encryption
- DOORKEEPER_ENCRYPTOR_SECRET_KEY=kjsdJKNfajJKfajrkjKjkjkfnewa
# Opentelemetry configurations
- OTEL_TRACE_ENDPOINT=otel_collector:4318
- OTEL_METRIC_ENDPOINT=otel_collector:4318
- OTEL_SERVICE_NAME=moilerplate-app
- OTEL_SERVICE_VERSION=v0.1.0
- OTEL_SERVICE_INSTANCE_ID=moilerplate-app
ports:
- 8082:8082
networks:
- moilerplate-network
depends_on:
- pg
- otel_collector
pg:
image: postgres:latest
container_name: moilerplate_pg
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=verystrongpassword
- POSTGRES_DB=moilerplate
restart: unless-stopped
ports:
- 5432:5432
volumes:
- pg-data:/var/lib/postgresql/data
networks:
- moilerplate-network
# OpenTelemetry Collector
otel_collector:
container_name: moilerplate_otel_collector
image: otel/opentelemetry-collector-contrib:0.70.0
command: --config=/etc/otel-collector-config.yaml
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "4318:4318" # OTLP over HTTP receiver
- "9464:9464" # Prometheus exporter
networks:
- moilerplate-network
depends_on:
- jaeger
- prometheus
# Jaeger
jaeger:
container_name: moilerplate_jaeger
image: jaegertracing/all-in-one:1.41.0
environment:
- SPAN_STORAGE_TYPE=cassandra
- CASSANDRA_SERVERS=cassandra
- CASSANDRA_KEYSPACE=jaeger_v1_datacenter1
ports:
- "14250:14250" # Collector gRPC
- "16686:16686" # Web HTTP
networks:
- moilerplate-network
depends_on:
cassandra:
condition: service_healthy
cassandra-schema:
condition: service_completed_successfully
cassandra-schema:
image: jaegertracing/jaeger-cassandra-schema:1.43
container_name: moilerplate_cassandra_schema
environment:
- CASSANDRA_PROTOCOL_VERSION=4
- CASSANDRA_VERSION=4
- CQLSH_HOST=cassandra
- DATACENTER=datacenter1 # Existing default datacenter
- MODE=prod
- REPLICATION_FACTOR=3
networks:
- moilerplate-network
depends_on:
cassandra:
condition: service_healthy
cassandra:
restart: always
image: cassandra:4.0
container_name: moilerplate_cassandra
ports:
- 9042:9042
volumes:
- cassandra-data:/var/lib/cassandra
networks:
- moilerplate-network
healthcheck:
test: ["CMD", "cqlsh", "-e", "describe keyspaces"]
interval: 1s
retries: 120
timeout: 1s
# Prometheus
prometheus:
container_name: moilerplate_prometheus
image: prom/prometheus:v2.42.0
command:
- --config.file=/etc/prometheus/prometheus.yaml
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yaml
- prometheus-data:/var/lib/prometheus
ports:
- "9090:9090"
networks:
- moilerplate-network
# Grafana
grafana:
container_name: moilerplate_grafana
image: grafana/grafana-oss
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
networks:
- moilerplate-network
depends_on:
- prometheus
# If we want to enable netdata, uncomment these lines:
# netdata:
# image: netdata/netdata:stable
# container_name: netdata
# pid: host
# network_mode: host
# restart: unless-stopped
# cap_add:
# - SYS_PTRACE
# - SYS_ADMIN
# security_opt:
# - apparmor:unconfined
# volumes:
# - moilerplate-netdataconfig:/etc/netdata
# - moilerplate-netdatalib:/var/lib/netdata
# - moilerplate-netdatacache:/var/cache/netdata
# - /etc/passwd:/host/etc/passwd:ro
# - /etc/group:/host/etc/group:ro
# - /etc/localtime:/etc/localtime:ro
# - /proc:/host/proc:ro
# - /sys:/host/sys:ro
# - /etc/os-release:/host/etc/os-release:ro
# - /var/log:/host/var/log:ro
# - /var/run/docker.sock:/var/run/docker.sock:ro
# environment:
# # For the environments of netdata, check your netdata console.
# - NETDATA_CLAIM_TOKEN=<FILL_IN>
# - NETDATA_CLAIM_URL=https://app.netdata.cloud
# - NETDATA_CLAIM_ROOMS=<FILL_IN>
volumes:
pg-data:
grafana-data:
prometheus-data:
cassandra-data:
# If we want to enable netdata, uncomment these lines:
# moilerplate-netdataconfig:
# moilerplate-netdatalib:
# moilerplate-netdatacache:
networks:
moilerplate-network: