-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
93 lines (87 loc) · 2.18 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
90
91
92
93
version: '2.1'
services:
fetcher:
build: web
container_name: ggstats_fetcher
hostname: ggstats_fetcher
restart: always
command: python3 manage.py fetcher
volumes:
- ./web/src:/src
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
SECRET_KEY: ${SECRET_KEY}
depends_on:
- db
logging: &default_logging
driver: json-file
options:
max-size: "5m"
max-file: "2"
healthcheck:
test: ["CMD-SHELL", "find /src/*.log -mmin -5 | grep '.*'"]
interval: 1m
labels:
autoheal: "true"
web:
build: web
container_name: ggstats_web
hostname: ggstats_web
restart: always
command: ./start.sh
logging: *default_logging
volumes:
- ./web/src:/src
- ./web/static:/static
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
SECRET_KEY: ${SECRET_KEY}
#ports:
# - "8080:8080"
networks:
- default
- nginx
depends_on:
- db
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8080/ | grep title"]
interval: 1m
labels:
autoheal: "true"
db:
image: mysql:5.7
container_name: ggstats_db
hostname: ggstats_db
restart: always
logging: *default_logging
volumes:
- ./mysql_data:/var/lib/mysql
- ./mysql/mysql.cnf:/etc/mysql/conf.d/mysql.cnf
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "mysqladmin --user=${MYSQL_USER} --password=${MYSQL_PASSWORD} ping"]
interval: 1m
labels:
autoheal: "true"
# https://github.com/moby/moby/issues/28400
# https://github.com/willfarrell/docker-autoheal
autoheal:
image: willfarrell/autoheal:v0.6.0
container_name: autoheal
hostname: autoheal
restart: always
logging: *default_logging
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
nginx:
external:
name: nginx_nginx