forked from tldr-devops/startpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
databases.yml
125 lines (115 loc) · 3.35 KB
/
databases.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
version: '3.8'
x-adminer-labels: &adminer-labels
labels:
- traefik.enable=true
- traefik.docker.network=database
- traefik.http.routers.adminer-http.rule=Host(`adminer.${DOMAIN?Variable not set}`)
- traefik.http.routers.adminer-http.entrypoints=http
#- traefik.http.routers.adminer-http.middlewares=admin-auth
- traefik.http.routers.adminer-http.service=adminer
- traefik.http.routers.adminer-http.middlewares=https-redirect
- traefik.http.routers.adminer-https.rule=Host(`adminer.${DOMAIN?Variable not set}`)
- traefik.http.routers.adminer-https.entrypoints=https
- traefik.http.routers.adminer-https.middlewares=admin-auth
- traefik.http.routers.adminer-https.tls=true
- traefik.http.routers.adminer-https.service=adminer
- traefik.http.routers.adminer-https.tls.certresolver=le
- traefik.http.services.adminer.loadbalancer.server.port=8080
x-service: &service
logging:
driver: json-file
options:
max-size: "100m"
max-file: "2"
restart: always
networks:
- database
x-service-deploy: &service-deploy
mode: replicated
replicas: 1
placement:
constraints:
- node.hostname == ${HOSTNAME?Variable HOSTNAME not set}
services:
# https://hub.docker.com/_/adminer
adminer:
container_name: adminer
image: adminer
deploy:
<<: *service-deploy
<<: *adminer-labels
placement: {}
resources:
reservations:
cpus: '0.01'
memory: 5M
<<: *adminer-labels
<<: *service
# https://hub.docker.com/_/mariadb
mariadb:
container_name: mariadb
image: mariadb:10.7
deploy:
<<: *service-deploy
resources:
reservations:
cpus: '0.01'
memory: 70M
<<: *service
environment:
MARIADB_ROOT_PASSWORD: ${SQL_ROOT_PASSWORD?Variable SQL_ROOT_PASSWORD not set}
#MARIADB_AUTO_UPGRADE: True
volumes:
- mariadb-data:/var/lib/mysql
- mariadb-entrypoint:/docker-entrypoint-initdb.d
# https://github.com/docker-library/docs/blob/master/postgres/README.md
postgres:
container_name: postgres
image: postgres:14
deploy:
<<: *service-deploy
resources:
reservations:
cpus: '0.01'
memory: 50M
<<: *service
environment:
POSTGRES_PASSWORD: ${SQL_ROOT_PASSWORD?Variable SQL_ROOT_PASSWORD not set}
PGDATA: "/var/lib/postgresql/data"
volumes:
- postgres-data:/var/lib/postgresql/data
- postgres-entrypoint:/docker-entrypoint-initdb.d
x-volume: &volume
driver: local
x-volume-driver-opts: &volume-driver-opts
type: none
o: bind
volumes:
mariadb-data:
name: mariadb-data
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/mariadb/data
mariadb-entrypoint:
name: mariadb-entrypoint
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/mariadb/entrypoint
postgres-data:
name: postgres-data
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/postgres/data
postgres-entrypoint:
name: postgres-entrypoint
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/postgres/entrypoint
networks:
database:
name: database
external: true