-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
162 lines (162 loc) · 4.34 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
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
version: '3'
services:
caddy:
image: ghcr.io/yorknouse/caddy:latest
restart: always
ports:
- 80:80
- 443:443
volumes:
- caddy:/data
- ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile
- ./ssl/ssl.key:/etc/ssl/private/ssl.key
- ./ssl/ssl.crt:/etc/ssl/certs/ssl.crt
- ./ssl/origin-pull-ca.pem:/etc/ssl/certs/origin-pull-ca.pem
environment:
ACME_AGREE: 'true'
env_file:
- nouseprod.env
depends_on:
- db
- nouse
- phpmyadmin
- grafana
db:
image: mysql/mysql-server:8.0
command: --default-authentication-plugin=mysql_native_password --innodb-thread-concurrency=0 --sort_buffer_size=512K --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
container_name: db
volumes:
- db_data:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
- ./docker/mysql/mysql.conf:/etc/mysql/my.cnf
- ./docker/mysql/readonly.sql:/docker-entrypoint-initdb.d/readonly.sql
restart: always
environment:
- MYSQL_DATABASE=nouse
- MYSQL_ROOT_HOST=%
- MYSQL_USER=userDocker
- MYSQL_PASSWORD=passDocker
- MYSQL_ROOT_PASSWORD=rootPass
env_file:
- nouseprod.env
ports:
- 3306:3306
nouse:
build:
context: .
dockerfile: ./Dockerfile
container_name: nouse-container
restart: always
depends_on:
- db
environment:
- MYSQL_HOSTNAME=db
- MYSQL_DATABASE=nouse
- MYSQL_USER=userDocker
- MYSQL_PASSWORD=passDocker
env_file:
- nouseprod.env
extra_hosts:
- "host.docker.internal:host-gateway"
phpmyadmin:
image: phpmyadmin/phpmyadmin:5.1
container_name: phpmyadmin
environment:
- PMA_HOST=db
- PMA_PORT=3306
- PMA_ARBITRARY=1
- PMA_USER=userDocker
- PMA_PASSWORD=passDocker
restart: always
depends_on:
- db
volumes:
- /sessions
compressor:
image: ghcr.io/yorknouse/image-compressor:latest
restart: unless-stopped
depends_on:
- db
environment:
- MYSQL_HOSTNAME=db
- MYSQL_DATABASE=nouse
- MYSQL_USER=userDocker
- MYSQL_PASSWORD=passDocker
- SLEEP_TIME=60
env_file:
- nouseprod.env
mysql-backup:
image: databack/mysql-backup:latest
restart: unless-stopped
container_name: mysql-backup
environment:
- DB_SERVER=db
- DB_PORT=3306
- DB_USER=root
- DB_PASS=rootPass
- DB_NAMES=nouse
- DB_DUMP_FREQ=120 #2 hours
- DB_DUMP_BEGIN=+10
- COMPRESSION=gzip
- NICE=true
env_file:
- nouseprod.env
depends_on:
- db
volumes:
- /etc/localtime:/etc/localtime:ro
grafana:
image: grafana/grafana:8.1.7-ubuntu
container_name: grafana
restart: unless-stopped
volumes:
- ./docker/grafana/config:/etc/grafana
- ./docker/grafana/dashboards:/var/lib/grafana/dashboards
depends_on:
- db
environment:
- GF_INSTALL_PLUGINS=grafana-clock-panel,cloudflare-app
- GF_INSTANCE_NAME=Nouse
netdata:
hostname: yusunouse01.york.ac.uk
image: netdata/netdata
container_name: netdata
restart: unless-stopped
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
environment:
- PGID=120 #This varies from server to server (https://learn.netdata.cloud/docs/agent/packaging/docker) - find it with grep docker /etc/group | cut -d ':' -f 3
depends_on: #Relies on everything because it needs to start last in order to access details of docker containers
- caddy
- nouse
- db
- phpmyadmin
- mysql-backup
- compressor
volumes:
- ./docker/netdata/config:/etc/netdata:ro
- netdatalib:/var/lib/netdata
- netdatacache:/var/cache/netdata
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
watchtower:
image: containrrr/watchtower
container_name: watchtower
restart: always
environment:
- WATCHTOWER_NO_STARTUP_MESSAGE=true
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_POLL_INTERVAL=30
volumes:
- /var/run/docker.sock:/var/run/docker.sock
volumes:
netdatalib:
netdatacache:
caddy:
db_data: { }