File tree Expand file tree Collapse file tree 9 files changed +89
-4
lines changed
ansible/roles/web_app/templates Expand file tree Collapse file tree 9 files changed +89
-4
lines changed Original file line number Diff line number Diff line change @@ -174,3 +174,6 @@ cython_debug/
174174.pypirc
175175terraform /yandex_cloud /key.json
176176terraform /yandex_cloud /terraform.rc
177+ ansible /roles /web_app /vars /main.yml
178+ ansible /ansible.builtin.env
179+ terraform /yandex_cloud /authorized_key.json
Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ USER $ADMIN_USER
1616RUN go build -o randomizer main.go
1717
1818# Explicitly specify port
19- EXPOSE 3000
19+ EXPOSE 5500
2020
2121CMD ["./randomizer" ]
Original file line number Diff line number Diff line change 88
99var tpl = template .Must (template .ParseFiles ("static/index.html" ))
1010
11- const PORT = "3000 "
11+ const PORT = "5500 "
1212
1313func indexHandler (w http.ResponseWriter , r * http.Request ) {
1414 // Handler calls template to show index.html
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 1+ version : " 3.3"
2+
3+ networks :
4+ loki :
5+
6+ services :
7+ loki :
8+ image : grafana/loki:latest
9+ ports :
10+ - " 3100:3100"
11+ command : -config.file=/etc/loki/local-config.yaml
12+ networks :
13+ - loki
14+
15+ promtail :
16+ image : grafana/promtail:latest
17+ volumes :
18+ - /var/log:/var/log
19+ - /var/run/docker.sock:/var/run/docker.sock
20+ - /var/lib/docker/containers:/var/lib/docker/containers
21+ - ./promtail.yml:/etc/promtail/config.yml
22+ command : -config.file=/etc/promtail/config.yml
23+ networks :
24+ - loki
25+
26+ grafana :
27+ environment :
28+ - GF_PATHS_PROVISIONING=/etc/grafana/provisioning
29+ - GF_AUTH_ANONYMOUS_ENABLED=true
30+ - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
31+ - GF_FEATURE_TOGGLES_ENABLE=alertingSimplifiedRouting,alertingQueryAndExpressionsStepMode
32+ entrypoint :
33+ - sh
34+ - -euc
35+ - |
36+ mkdir -p /etc/grafana/provisioning/datasources
37+ cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
38+ apiVersion: 1
39+ datasources:
40+ - name: Loki
41+ type: loki
42+ access: proxy
43+ orgId: 1
44+ url: http://loki:3100
45+ basicAuth: false
46+ isDefault: true
47+ version: 1
48+ editable: false
49+ EOF
50+ /run.sh
51+ image : grafana/grafana:latest
52+ ports :
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 1+ server :
2+ http_listen_port : 9080
3+ grpc_listen_port : 0
4+ positions :
5+ filename : /tmp/positions.yaml
6+ client :
7+ url : http://loki:3100/api/v1/push
8+ scrape_configs :
9+ - job_name : logging_both_dockersW
10+ static_configs :
11+ - targets :
12+ - localhost
13+ labels :
14+ job : docker
15+ __path__ : /var/lib/docker/containers/*/*log # For linux only
You can’t perform that action at this time.
0 commit comments