-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
89 lines (83 loc) · 1.95 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
version: "3.8"
networks:
main:
name: minitwit-network
services:
postgres:
container_name: minitwit-postgres
image: postgres
restart: always
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
ports:
- '5432:5432'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin -d minitwitdb"]
interval: 5s
timeout: 5s
retries: 5
networks:
- main
web:
image: minitwit-webapp
container_name: minitwit
depends_on:
postgres:
condition: service_healthy
grafana:
condition: service_started
prometheus:
condition: service_started
logging:
driver: loki
options:
loki-url: "http://admin:admin@localhost:3100/loki/api/v1/push"
build:
context: .
dockerfile: Dockerfile
args:
BUILDKIT_PROGRESS: plain docker-compose build
ports:
- '8080:8080'
environment:
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_HOST=${DB_HOST}
- DB_NAME=${DB_NAME}
- DB_PORT=${DB_PORT}
- PORT=${PORT}
- SESSION_KEY=${SESSION_KEY}
- GIN_MODE=${GIN_MODE}
restart: always
links:
- postgres:database
networks:
- main
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus:/prometheus
ports:
- "9090:9090"
networks:
- main
grafana:
image: grafana/grafana:9.4.7
container_name: grafana
volumes:
- ./grafana/dashboards:/var/lib/grafana/dashboards
- ./grafana/provisioning:/etc/grafana/provisioning
ports:
- "3000:3000"
networks:
- main
loki:
image: grafana/loki:2.8.0
ports:
- "3100:3100"
networks:
- main