Skip to content

Commit 55f7232

Browse files
author
t.suleymanov
committed
lab07 6/10 still permission denied for loki
1 parent 141377a commit 55f7232

File tree

4 files changed

+27
-23
lines changed

4 files changed

+27
-23
lines changed

app_python/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ RUN adduser --system $ADMIN_USER
1717
USER $ADMIN_USER
1818

1919
# Explicitly specify port
20-
EXPOSE 5000
20+
EXPOSE 5005
2121

2222
CMD ["python", "moscow_app.py"]

app_python/moscow_app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
app = Flask(__name__)
99
MOSCOW = timezone(timedelta(hours=3), "Moscow")
10+
HOST = "0.0.0.0"
11+
PORT = 5005
1012

1113
@app.route("/")
1214
def index():
@@ -21,4 +23,4 @@ def index():
2123

2224

2325
if __name__ == "__main__":
24-
app.run()
26+
app.run(HOST, PORT)

monitoring/docker-compose.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,27 @@
11
version: "3.3"
22

3+
networks:
4+
loki:
5+
36
services:
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"

monitoring/promtail.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ positions:
66
client:
77
url: http://loki:3100/api/v1/push
88
scrape_configs:
9-
- job_name: logging_both_dockers
10-
9+
- job_name: logging_both_dockersW
1110
static_configs:
1211
- targets:
1312
- localhost

0 commit comments

Comments
 (0)