-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
161 lines (155 loc) · 3.89 KB
/
docker-compose.yml
File metadata and controls
161 lines (155 loc) · 3.89 KB
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
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
- VERSION=${VERSION:-dev}
- BUILD_TIME=${BUILD_TIME:-unknown}
- GIT_COMMIT=${GIT_COMMIT:-unknown}
image: brandishbot:dev
ports:
- '8080:8080'
env_file:
- .env
environment:
- DB_HOST=db
volumes:
- ./logs:/app/logs
- ./configs:/app/configs:ro
depends_on:
- db
restart: unless-stopped
networks:
- backend
extra_hosts:
- 'host.docker.internal:host-gateway'
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
discord:
build:
context: .
dockerfile: Dockerfile.discord
image: brandishbot-discord:dev
env_file:
- .env
environment:
- API_URL=http://app:8080
depends_on:
- app
restart: always
volumes:
# Mount configs so /info command can read documentation
- ./configs:/app/configs:ro
# Mount MapRando presets
- ${MAPRANDO_PRESETS_DIR}:/app/maprando_presets:ro
# Mount media assets
- ./media:/app/media:ro
# Optional: Mount logs for persistence
# - ./logs/discord:/app/logs
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:8082/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
deploy:
resources:
limits:
memory: 256M
cpus: '0.5'
reservations:
memory: 128M
cpus: '0.25'
networks:
- backend
extra_hosts:
- 'host.docker.internal:host-gateway'
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
db:
image: postgres:15
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
# Port binding for local development
# Note: On some systems, use firewall to restrict access if needed
- '5432:5432'
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- backend
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
restart: unless-stopped
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${DB_USER} -d ${DB_NAME}']
interval: 10s
timeout: 5s
retries: 5
prometheus:
image: prom/prometheus:latest
ports:
- '9090:9090'
volumes:
- ./configs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./configs/prometheus/alerts:/etc/prometheus/alerts:ro
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=15d'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--web.enable-lifecycle'
depends_on:
- app
restart: unless-stopped
networks:
- backend
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
grafana:
image: grafana/grafana:latest
ports:
- '3000:3000'
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
- GF_SERVER_ROOT_URL=${GRAFANA_ROOT_URL:-http://localhost:3000}
- GF_INSTALL_PLUGINS=
volumes:
- ./configs/grafana/provisioning:/etc/grafana/provisioning:ro
- ./configs/grafana/dashboards:/etc/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
depends_on:
- prometheus
restart: unless-stopped
networks:
- backend
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
volumes:
pgdata:
prometheus-data:
grafana-data:
networks:
backend:
driver: bridge