This repository has been archived by the owner on Jun 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
docker-compose.yml
162 lines (161 loc) · 5.79 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.4"
services:
netmaker:
container_name: netmaker
image: gravitl/netmaker:v0.17.1
cap_add:
- NET_ADMIN
- NET_RAW
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
- net.ipv6.conf.all.disable_ipv6=0
- net.ipv6.conf.all.forwarding=1
restart: always
volumes:
- dnsconfig:/root/config/dnsconfig
- sqldata:/root/data
- mosquitto_data:/etc/netmaker
environment:
SERVER_NAME: "broker.${NETMAKER_BASE_DOMAIN}"
SERVER_HOST: "${SERVER_PUBLIC_IP}"
SERVER_API_CONN_STRING: "api.${NETMAKER_BASE_DOMAIN}:443"
COREDNS_ADDR: "${SERVER_PUBLIC_IP}"
DNS_MODE: "on"
SERVER_HTTP_HOST: "api.${NETMAKER_BASE_DOMAIN}"
API_PORT: "8081"
CLIENT_MODE: "on"
MASTER_KEY: "${NETMAKER_MASTER_KEY}"
CORS_ALLOWED_ORIGIN: "*"
DISPLAY_KEYS: "on"
DATABASE: "sqlite"
NODE_ID: "netmaker-server-1"
MQ_HOST: "mq"
MQ_PORT: "443"
MQ_SERVER_PORT: "1883"
HOST_NETWORK: "off"
VERBOSITY: "1"
MANAGE_IPTABLES: "on"
PORT_FORWARD_SERVICES: "dns"
MQ_ADMIN_PASSWORD: "${NETMAKER_MQ_ADMIN_PASSWORD}"
ports:
- "51821-51830:51821-51830/udp"
labels:
- traefik.enable=true
- traefik.http.routers.netmaker-api.entrypoints=websecure
- traefik.http.routers.netmaker-api.rule=Host(`api.${NETMAKER_BASE_DOMAIN}`)
- traefik.http.routers.netmaker-api.service=netmaker-api
- traefik.http.services.netmaker-api.loadbalancer.server.port=8081
netmaker-ui:
container_name: netmaker-ui
image: gravitl/netmaker-ui:v0.17.1
depends_on:
- netmaker
links:
- "netmaker:api"
restart: always
environment:
BACKEND_URL: "https://api.${NETMAKER_BASE_DOMAIN}"
labels:
- traefik.enable=true
- traefik.http.routers.netmaker-ui-http.entrypoints=web
- traefik.http.routers.netmaker-ui-http.rule=Host(`dashboard.${NETMAKER_BASE_DOMAIN}`)
- traefik.http.middlewares.nmui-security.headers.accessControlAllowOriginList=*.${NETMAKER_BASE_DOMAIN}
- traefik.http.middlewares.nmui-security.headers.stsSeconds=31536000
- traefik.http.middlewares.nmui-security.headers.browserXssFilter=true
- traefik.http.middlewares.nmui-security.headers.customFrameOptionsValue=SAMEORIGIN
- traefik.http.middlewares.nmui-security.headers.customResponseHeaders.X-Robots-Tag=none
- traefik.http.middlewares.nmui-security.headers.customResponseHeaders.Server= # Remove the server name
- traefik.http.routers.netmaker-ui.middlewares=nmui-security@docker
- traefik.http.routers.netmaker-ui.entrypoints=websecure
- traefik.http.routers.netmaker-ui.rule=Host(`dashboard.${NETMAKER_BASE_DOMAIN}`)
- traefik.http.routers.netmaker-ui.service=netmaker-ui
- traefik.http.services.netmaker-ui.loadbalancer.server.port=80
coredns:
container_name: coredns
image: coredns/coredns
command: -conf /root/dnsconfig/Corefile
depends_on:
- netmaker
restart: always
volumes:
- dnsconfig:/root/dnsconfig
traefik:
image: traefik:v2.9
container_name: traefik
command:
- "--log.level=INFO"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.websecure.http.tls=true"
- "--entrypoints.websecure.http.tls.certResolver=letsencrypt"
- "--certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL}"
- "--certificatesresolvers.letsencrypt.acme.storage=/acme.json"
- "--certificatesresolvers.letsencrypt.acme.httpChallenge.entrypoint=web"
- "--providers.docker=true"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.exposedByDefault=false"
- "--serverstransport.insecureskipverify=true"
- "--api.insecure=true"
- "--api.dashboard=true"
restart: always
volumes:
- /etc/localtime:/etc/localtime:ro
- ${TRAEFIK_DOCKER_HOST}:/var/run/docker.sock:ro
- /PATHTO/traefik_acme.json:/acme.json
ports:
- "80:80"
- "443:443"
labels:
- traefik.enable=true
- traefik.http.routers.traefik-http.entrypoints=web
- traefik.http.routers.traefik-http.rule=Host(`${TRAEFIK_DOMAIN}`)
- traefik.http.routers.traefik=api@internal
- traefik.http.middlewares.secure-ips.ipwhitelist.sourcerange=192.168.129.0/16,172.16.0.0/12,10.0.0.0/8
- traefik.http.routers.traefik.middlewares=secure-ips@docker
- traefik.http.routers.traefik.entrypoints=websecure
- traefik.http.routers.traefik.rule=Host(`${TRAEFIK_DOMAIN}`)
- traefik.http.routers.traefik.service=api@internal
- traefik.http.services.traefik-containers.loadbalancer.server.port=8080
mq:
container_name: mq
image: eclipse-mosquitto:2.0.15-openssl
depends_on:
- netmaker
restart: unless-stopped
command: ["/mosquitto/config/wait.sh"]
environment:
NETMAKER_SERVER_HOST: "https://api.${NETMAKER_BASE_DOMAIN}"
volumes:
- /PATHTO/mosquitto.conf:/mosquitto/config/mosquitto.conf
- /PATHTO/wait.sh:/mosquitto/config/wait.sh
- mosquitto_data:/mosquitto/data
- mosquitto_logs:/mosquitto/log
volumes:
sqldata:
driver: local
driver_opts:
type: none
device: /PATHTO/netmaker_sqldata
o: bind
dnsconfig:
driver: local
driver_opts:
type: none
device: /PATHTO/netmaker_dnsconfig
o: bind
mosquitto_data:
driver: local
driver_opts:
type: none
device: /PATHTO/netmaker_mosquitto_data
o: bind
mosquitto_logs:
driver: local
driver_opts:
type: none
device: /PATHTO/netmaker_mosquitto_logs
o: bind