File tree Expand file tree Collapse file tree 4 files changed +27
-23
lines changed Expand file tree Collapse file tree 4 files changed +27
-23
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,6 @@ RUN adduser --system $ADMIN_USER
1717USER $ADMIN_USER
1818
1919# Explicitly specify port
20- EXPOSE 5000
20+ EXPOSE 5005
2121
2222CMD ["python" , "moscow_app.py" ]
Original file line number Diff line number Diff line change 77
88app = Flask (__name__ )
99MOSCOW = timezone (timedelta (hours = 3 ), "Moscow" )
10+ HOST = "0.0.0.0"
11+ PORT = 5005
1012
1113@app .route ("/" )
1214def index ():
@@ -21,4 +23,4 @@ def index():
2123
2224
2325if __name__ == "__main__" :
24- app .run ()
26+ app .run (HOST , PORT )
Original file line number Diff line number Diff line change 11version : " 3.3"
22
3+ networks :
4+ loki :
5+
36services :
4- moscow_time :
5- image : tjann7/moscow_time:latest
6- ports :
7- - " 5000:5000"
8- logging :
9- driver : " json-file"
10- healthcheck :
11- test : [ "CMD-SHELL", "curl --fail http://localhost:5000 || exit 1" ]
12- interval : 5s
13- timeout : 5s
14- retries : 5
15- go_random :
16- image : tjann7/go_random:latest
17- ports :
18- - " 5500:5500"
19- logging :
20- driver : " json-file"
217 loki :
228 image : grafana/loki:latest
239 ports :
2410 - " 3100:3100"
2511 command : -config.file=/etc/loki/local-config.yaml
12+ networks :
13+ - loki
2614
2715 promtail :
2816 image : grafana/promtail:latest
2917 volumes :
3018 - /var/log:/var/log
31- - /var/lib/docker/containers:/var/lib/docker/containers:ro
19+ - /var/run/docker.sock:/var/run/docker.sock
20+ - /var/lib/docker/containers:/var/lib/docker/containers
3221 - ./promtail.yml:/etc/promtail/config.yml
3322 command : -config.file=/etc/promtail/config.yml
23+ networks :
24+ - loki
3425
3526 grafana :
3627 environment :
@@ -59,4 +50,16 @@ services:
5950 /run.sh
6051 image : grafana/grafana:latest
6152 ports :
62- - " 3000:3000"
53+ - " 3000:3000"
54+ networks :
55+ - loki
56+ moscow_time :
57+ image : tjann7/moscow_time:latest
58+ ports :
59+ - " 5005:5005"
60+ logging :
61+ driver : " json-file"
62+ go_random :
63+ image : tjann7/go_random:latest
64+ ports :
65+ - " 5500:5500"
Original file line number Diff line number Diff line change @@ -6,8 +6,7 @@ positions:
66client :
77 url : http://loki:3100/api/v1/push
88scrape_configs :
9- - job_name : logging_both_dockers
10-
9+ - job_name : logging_both_dockersW
1110 static_configs :
1211 - targets :
1312 - localhost
You can’t perform that action at this time.
0 commit comments