-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
165 lines (156 loc) · 3.79 KB
/
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
services:
db:
image: pgautoupgrade/pgautoupgrade:latest
container_name: postgres
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"
expose:
- "5432"
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready",
"--host=db",
"--username=postgres"
]
interval: 10s
timeout: 5s
retries: 5
init: true
user: postgres
volumes:
- postgres-data:/var/lib/postgresql/data/
redis:
image: "redis:alpine"
container_name: redis
expose:
- "6379"
init: true
volumes:
- redis-data:/data
stop_signal: SIGKILL
########################################################
# Example Dramatiq (Async task runner) and Django web
# containers. You would replace this section with your
# own code/containers.
########################################################
# worker:
# build:
# context: .
# dockerfile: docker/Dockerfile
# container_name: worker
# depends_on:
# db:
# condition: "service_started"
# env_file: .env
# init: true
# ports:
# - "9191:9191"
# volumes:
# - .:/code
# - "/tmp/dramatiq-prometheus"
# working_dir: /code
# environment:
# - "prometheus_multiproc_dir=/tmp/dramatiq-prometheus"
# - "dramatiq_prom_db=/tmp/dramatiq-prometheus"
# command: [
# "python",
# "manage.py",
# "rundramatiq"
# ]
# stop_signal: SIGKILL
# web:
# build:
# context: .
# dockerfile: docker/Dockerfile
# container_name: web
# depends_on:
# db:
# condition: "service_started"
# env_file: .env
# init: true
# volumes:
# - .:/code
# working_dir: /code
# command: [
# "/bin/bash",
# "/code/compose-start.sh",
# ]
# ports:
# - "8000:8000"
# tty: true
################################################################
# Monitoring
################################################################
prometheus:
image: prom/prometheus
volumes:
- "./docker/prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
- 9090:9090
loki:
image: grafana/loki:2.9.2
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
vector:
image: timberio/vector:0.36.0-debian
hostname: vector
container_name: vector
depends_on:
loki:
condition: "service_started"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "./docker/vector.yaml:/etc/vector/vector.yaml"
ports:
- 27832:27832
- 27839:27839
- 44223:44223
- 16902:16902
grafana:
container_name: grafana
environment:
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
entrypoint:
- sh
- -euc
- |
mkdir -p /etc/grafana/provisioning/datasources
cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
orgId: 1
url: http://loki:3100
basicAuth: false
isDefault: true
version: 1
editable: false
- name: Prometheus
type: prometheus
access: proxy
orgId: 1
url: http://prometheus:9090
jsonData:
httpMethod: POST
manageAlerts: true
prometheusType: Prometheus
prometheusVersion: 2.44.0
cacheLevel: 'High'
disableRecordingRules: false
incrementalQueryOverlapWindow: 10m
EOF
/run.sh
image: grafana/grafana:latest
ports:
- "3000:3000"
stop_signal: SIGKILL
volumes:
postgres-data:
redis-data: