-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbase.yml
More file actions
223 lines (209 loc) · 6.83 KB
/
base.yml
File metadata and controls
223 lines (209 loc) · 6.83 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
version: '3'
volumes:
production_postgres_data: {}
production_postgres_data_backups: {}
production_traefik: {}
services:
django:
image: "cyber5k/mistborn:${MISTBORN_TAG}"
container_name: mistborn_production_django
depends_on:
- postgres
- redis
ports:
- "10.2.3.1:5000:5000/tcp" # auth access
labels:
- "traefik.enable=true"
- "traefik.http.routers.django-http.rule=Host(`home.mistborn`)"
- "traefik.http.routers.django-http.entrypoints=web"
- "traefik.http.routers.django-http.middlewares=mistborn_headers@file"
- "traefik.http.routers.django-https.rule=Host(`home.mistborn`)"
- "traefik.http.routers.django-https.entrypoints=websecure"
- "traefik.http.routers.django-https.middlewares=mistborn_headers@file"
- "traefik.http.routers.django-https.tls.certresolver=basic"
- "traefik.http.services.django-service.loadbalancer.server.port=5000"
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
volumes:
- ../mistborn_volumes/base/media:/mistborn-media
- ../mistborn_volumes/base/private_media:/mistborn-private-media
command: /start
restart: unless-stopped
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: mistborn_production_postgres
container_name: mistborn_production_postgres
volumes:
- production_postgres_data:/var/lib/postgresql/data
- production_postgres_data_backups:/backups
env_file:
- ./.envs/.production/.postgres
restart: unless-stopped
traefik:
#build:
# context: .
# dockerfile: ./compose/production/traefik/Dockerfile
#image: mistborn_production_traefik
image: traefik:v2.2
container_name: mistborn_production_traefik
depends_on:
- django
volumes:
#- production_traefik:/etc/traefik/acme
- ./compose/production/traefik/dynamic.toml:/dynamic.toml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ../mistborn_volumes/base/tls:/tls:ro
network_mode: host
#ports:
# - "0.0.0.0:80:80/tcp"
# - "0.0.0.0:443:443/tcp"
# #- "0.0.0.0:8080:8080/tcp" # dashboard
command:
## API settings
#- --api.insecure=true
#- --api.dashboard=true
#- --api.debug=true
## Logs
- --log.level=ERROR
## Providers
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.file.filename=/dynamic.toml
#- --providers.docker.network=default
## Entrypoints
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
## Certificates
#- --serversTransport.insecureSkipVerify=true
restart: unless-stopped
redis:
image: redis:5.0
container_name: mistborn_production_redis
restart: unless-stopped
celeryworker:
image: "cyber5k/mistborn:${MISTBORN_TAG}"
container_name: mistborn_production_celeryworker
volumes:
- /home/mistborn/.ssh:/ssh
- ../mistborn_volumes/base/media:/mistborn-media
- ../mistborn_volumes/base/private_media:/mistborn-private-media
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
- ./.envs/.production/.pihole
networks:
default:
dns_net:
ipv4_address: 10.2.1.3
dns:
- 10.2.1.2
depends_on:
- traefik
- pihole
command: /start-celeryworker
restart: unless-stopped
celeryworker-low-priority:
image: "cyber5k/mistborn:${MISTBORN_TAG}"
container_name: mistborn_production_celeryworker_low_priority
volumes:
- /home/mistborn/.ssh:/ssh
- ../mistborn_volumes/base/media:/mistborn-media
- ../mistborn_volumes/base/private_media:/mistborn-private-media
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
- ./.envs/.production/.pihole
networks:
default:
dns_net:
ipv4_address: 10.2.1.4
dns:
- 10.2.1.2
depends_on:
- traefik
- pihole
command: /start-celeryworker-low-priority
restart: unless-stopped
celerybeat:
image: "cyber5k/mistborn:${MISTBORN_TAG}"
container_name: mistborn_production_celerybeat
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
command: /start-celerybeat
restart: unless-stopped
#flower:
# image: "cyber5k/mistborn:${MISTBORN_TAG}"
# container_name: mistborn_production_flower
# env_file:
# - ./.envs/.production/.django
# - ./.envs/.production/.postgres
# ports:
# - "5555:5555/tcp"
# command: /start-flower
# restart: unless-stopped
pihole:
container_name: mistborn_production_pihole
image: pihole/pihole:v5.7
env_file:
- ./.envs/.production/.pihole
ports:
- "${MISTBORN_DNS_BIND_IP}:53:53/tcp"
- "${MISTBORN_DNS_BIND_IP}:53:53/udp"
labels:
- "traefik.enable=true"
- "traefik.http.routers.pihole-http.rule=Host(`pihole.mistborn`)"
- "traefik.http.routers.pihole-http.entrypoints=web"
- "traefik.http.routers.pihole-http.middlewares=mistborn_auth@file,add-pihole-admin"
- "traefik.http.routers.pihole-https.rule=Host(`pihole.mistborn`)"
- "traefik.http.routers.pihole-https.entrypoints=websecure"
- "traefik.http.routers.pihole-https.middlewares=mistborn_auth@file,add-pihole-admin"
- "traefik.http.routers.pihole-https.tls.certresolver=basic"
- "traefik.http.middlewares.add-pihole-admin.addPrefix.prefix=/admin"
- "traefik.http.services.pihole-service.loadbalancer.server.port=80"
environment:
- ServerIP=10.2.0.3
- DNS1='10.2.0.2#5054' # docs say port 5054, was 54; use network_mode: host to see which port is used
- DNS2=''
- IPv6='false'
- DNSMASQ_LISTENING=all
# TZ: 'America/New York'
# Volumes store your data between container upgrades
volumes:
- ../mistborn_volumes/base/pihole/etc-pihole:/etc/pihole/
- ../mistborn_volumes/base/pihole/etc-dnsmasqd:/etc/dnsmasq.d/
dns:
- 127.0.0.1
networks:
default:
pihole_net:
ipv4_address: 10.2.0.3
dns_net:
ipv4_address: 10.2.1.2
restart: unless-stopped
dnscrypt-proxy:
container_name: mistborn_production_dnscrypt_proxy
image: cyber5k/dnscrypt-proxy:latest
environment:
- DNSCRYPT_LISTEN_PORT=5054
# resolvers: https://download.dnscrypt.info/dnscrypt-resolvers/v2/public-resolvers.md
#- DNSCRYPT_SERVER_NAMES=['scaleway-fr','google','yandex','cloudflare']
- DNSCRYPT_SERVER_NAMES=['cloudflare','dnswarden-doh1','dnswarden-doh2','dnswarden-doh3','adguard-dns-doh']
networks:
pihole_net:
ipv4_address: 10.2.0.2
restart: unless-stopped
networks:
pihole_net:
driver: bridge
ipam:
config:
- subnet: 10.2.0.0/29
dns_net:
driver: bridge
ipam:
config:
- subnet: 10.2.1.0/24