-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
175 lines (166 loc) · 4.48 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
#
# Development (localhost) docker compose file
#
version: "3.0"
services:
moilerplate:
build:
context: .
dockerfile: Dockerfile.dev
container_name: moilerplate_app
image: moilerplate-app-dev
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=2
- BURST_LIMIT=2
- RATER_EVALUATION_INTERVAL=1m
- RATER_DELETION_TIME=3m
# 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
volumes:
- ./:/app # Include the content of root dir for hot reload
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:ro
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_dc1
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
- MODE=test
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.yaml
volumes:
- ./prometheus.yaml:/etc/prometheus.yaml:ro
- 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
volumes:
pg-data:
grafana-data:
prometheus-data:
cassandra-data:
networks:
moilerplate-network: