@@ -2,6 +2,7 @@ name: ttt
22
33services :
44 ttt :
5+ image : ttt:prod
56 build :
67 context : ../../
78 dockerfile : deploy/prod/ttt/Dockerfile
@@ -26,7 +27,7 @@ services:
2627 TTT_POSTGRES_POOL_TIMEOUT_SECONDS : 45
2728 TTT_POSTGRES_POOL_RECYCLE_SECONDS : 1800
2829 TTT_POSTGRES_POOL_PRE_PING : false
29- TTT_POSTGRES_ECHO : true
30+ TTT_POSTGRES_ECHO : false
3031
3132 TTT_REDIS_URL : redis://:${REDIS_PASSWORD}@redis:6379/0
3233 TTT_REDIS_POOL_SIZE : 16
@@ -86,7 +87,7 @@ services:
8687 mem_limit : 30mb
8788 healthcheck :
8889 test : pg_isready -d ttt -U ttt
89- start_period : 1m
90+ start_period : 2m
9091 start_interval : 1s
9192 interval : 5s
9293
@@ -116,7 +117,7 @@ services:
116117 mem_limit : 30mb
117118 healthcheck :
118119 test : pg_isready -d ttt -U ttt
119- start_period : 1m
120+ start_period : 2m
120121 start_interval : 1s
121122 interval : 5s
122123
@@ -154,6 +155,57 @@ services:
154155 entrypoint : [""]
155156 command : ["bash", "/mnt/add_streams.sh"]
156157
158+ alloy :
159+ image : grafana/alloy:v1.10.0
160+ container_name : ttt-alloy
161+ volumes :
162+ - ./alloy/config.alloy:/etc/alloy/config.alloy
163+ - /var/run/docker.sock:/var/run/docker.sock
164+ networks :
165+ - loki
166+ command : run --server.http.listen-addr=0.0.0.0:12345 --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy
167+ depends_on :
168+ - loki
169+
170+ loki :
171+ image : grafana/loki:3.4.5
172+ container_name : ttt-loki
173+ environment :
174+ TZ : ${SYSTEM_TIMEZONE:-Europe/Moscow}
175+ volumes :
176+ - loki-data:/loki
177+ - ./loki/loki-config.yaml:/etc/loki/local-config.yaml
178+ networks :
179+ - loki
180+ command : -config.file=/etc/loki/local-config.yaml
181+
182+ grafana :
183+ image : grafana/grafana:12.0.2-ubuntu
184+ container_name : ttt-grafana
185+ environment :
186+ - GF_PATHS_PROVISIONING=/etc/grafana/provisioning
187+ - GF_FEATURE_TOGGLES_ENABLE=grafanaManagedRecordingRules
188+
189+ - GF_AUTH_ANONYMOUS_ENABLED=false
190+ - GF_AUTH_BASIC_ENABLED=true
191+
192+ - GF_SECURITY_FORCE_PASSWORD_CHANGE=true
193+ - GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION=false
194+ - GF_SECURITY_ADMIN_USER=admin
195+ - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
196+ - GF_SECURITY_MIN_PASSWORD_LENGTH=4
197+
198+ - GF_USERS_ALLOW_SIGN_UP=false
199+
200+ - TZ=${SYSTEM_TIMEZONE:-Europe/Moscow}
201+ ports :
202+ - 3000:3000
203+ volumes :
204+ - grafana-data:/var/lib/grafana
205+ - ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
206+ networks :
207+ - loki
208+
157209volumes :
158210 postgres-replica1-data :
159211 name : " ttt-prod-postgres-replica1-data"
@@ -163,11 +215,16 @@ volumes:
163215 name : " ttt-prod-redis-data"
164216 nats-data :
165217 name : " ttt-prod-nats-data"
218+ loki-data :
219+ name : " ttt-prod-loki-data"
220+ grafana-data :
221+ name : " ttt-prod-grafana-data"
166222
167223networks :
168224 postgres : null
169225 redis : null
170226 nats : null
227+ loki : null
171228
172229secrets :
173230 secrets :
0 commit comments