-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
148 lines (139 loc) · 3.98 KB
/
docker-compose.yaml
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
x-restart-policy: &restart_policy
restart: unless-stopped
x-depends_on-healthy: &depends_on-healthy
condition: service_healthy
x-healthcheck-defaults: &healthcheck_defaults
# Avoid setting the interval too small, as docker uses much more CPU than one would expect.
# Related issues:
# https://github.com/moby/moby/issues/39102
# https://github.com/moby/moby/issues/39388
interval: "$HEALTHCHECK_INTERVAL"
timeout: "$HEALTHCHECK_TIMEOUT"
retries: $HEALTHCHECK_RETRIES
start_period: 10s
x-beatsight-defaults: &beatsight_defaults
<<: *restart_policy
image: ${BEATSIGHT_IMAGE}
# Set the platform to build for linux/arm64 when needed on Apple silicon Macs.
platform: ${DOCKER_PLATFORM:-}
depends_on:
redis:
<<: *depends_on-healthy
postgres:
<<: *depends_on-healthy
rabbitmq:
<<: *depends_on-healthy
command: ["beatsight"]
environment:
PYTHONPATH: "/home/beatsight/app/vendor/repostat"
# Leaving the value empty to just pass whatever is set
# on the host system (or in the .env file)
COMPOSE_PROFILES:
volumes:
- "beatsight-data:/data"
- "../runtime:/home/beatsight/runtime"
- "../logs:/home/beatsight/logs"
- "../license.json:/home/beatsight/app/core-serv/license.json"
services:
web:
<<: *beatsight_defaults
container_name: beatsight-web
ulimits:
nofile:
soft: 4096
hard: 4096
healthcheck:
<<: *healthcheck_defaults
test:
- "CMD"
- "/bin/bash"
- "-c"
# Courtesy of https://unix.stackexchange.com/a/234089/108960
- 'exec 3<>/dev/tcp/127.0.0.1/9998 && echo -e "GET /api/core/_health/ HTTP/1.1\r\nhost: 127.0.0.1\r\n\r\n" >&3 && grep ok -s -m 1 <&3'
networks:
- beatsight-net
ports:
- "$BEATSIGHT_BIND:80/tcp"
celery:
<<: *beatsight_defaults
container_name: beatsight-celery
ulimits:
nofile:
soft: 4096
hard: 4096
entrypoint: /home/beatsight/build/start-celery.sh
networks:
- beatsight-net
beat:
<<: *beatsight_defaults
container_name: beatsight-beat
ulimits:
nofile:
soft: 4096
hard: 4096
entrypoint: /home/beatsight/build/start-beat.sh
networks:
- beatsight-net
postgres:
<<: *restart_policy
container_name: beatsight-postgres
# Using the same postgres version as Sentry dev for consistency purposes
image: "postgres:14-bullseye"
healthcheck:
<<: *healthcheck_defaults
# Using default user "postgres" from sentry/sentry.conf.example.py or value of POSTGRES_USER if provided
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
command:
[
"postgres",
"-c",
"max_connections=${POSTGRES_MAX_CONNECTIONS:-100}",
]
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
volumes:
- "beatsight-postgres:/var/lib/postgresql/data"
networks:
- beatsight-net
redis:
<<: *restart_policy
container_name: beatsight-redis
image: "redis:6.2.14-alpine"
healthcheck:
<<: *healthcheck_defaults
test: redis-cli ping
volumes:
- "beatsight-redis:/data"
ulimits:
nofile:
soft: 10032
hard: 10032
networks:
- beatsight-net
rabbitmq:
container_name: beatsight-mq
image: "rabbitmq:3-management-alpine"
healthcheck:
<<: *healthcheck_defaults
test: rabbitmq-diagnostics -q ping
volumes:
- beatsight-mq:/var/lib/rabbitmq
- beatsight-mq-log:/var/log/rabbitmq
networks:
- beatsight-net
volumes:
# These store application data that should persist across restarts.
beatsight-data:
external: true
beatsight-postgres:
external: true
beatsight-redis:
external: true
beatsight-mq:
external: true
# These store ephemeral data that needn't persist across restarts.
# That said, volumes will be persisted across restarts until they are deleted.
beatsight-mq-log:
networks:
beatsight-net:
driver: bridge