docker-compose.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. version: "3.4"
  2. services:
  3. netmaker:
  4. container_name: netmaker
  5. image: gravitl/netmaker:v0.14.5
  6. cap_add:
  7. - NET_ADMIN
  8. - NET_RAW
  9. - SYS_MODULE
  10. sysctls:
  11. - net.ipv4.ip_forward=1
  12. - net.ipv4.conf.all.src_valid_mark=1
  13. - net.ipv6.conf.all.disable_ipv6=0
  14. - net.ipv6.conf.all.forwarding=1
  15. restart: always
  16. volumes:
  17. - dnsconfig:/root/config/dnsconfig
  18. - sqldata:/root/data
  19. - shared_certs:/etc/netmaker
  20. environment:
  21. SERVER_NAME: "broker.NETMAKER_BASE_DOMAIN"
  22. SERVER_HOST: "SERVER_PUBLIC_IP"
  23. SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
  24. COREDNS_ADDR: "SERVER_PUBLIC_IP"
  25. DNS_MODE: "on"
  26. SERVER_HTTP_HOST: "api.NETMAKER_BASE_DOMAIN"
  27. API_PORT: "8081"
  28. CLIENT_MODE: "on"
  29. MASTER_KEY: "REPLACE_MASTER_KEY"
  30. CORS_ALLOWED_ORIGIN: "*"
  31. DISPLAY_KEYS: "on"
  32. DATABASE: "sqlite"
  33. NODE_ID: "netmaker-server-1"
  34. MQ_HOST: "mq"
  35. MQ_PORT: "443"
  36. MQ_SERVER_PORT: "1883"
  37. HOST_NETWORK: "off"
  38. VERBOSITY: "1"
  39. MANAGE_IPTABLES: "on"
  40. PORT_FORWARD_SERVICES: "dns"
  41. ports:
  42. - "51821-51830:51821-51830/udp"
  43. expose:
  44. - "8081"
  45. labels:
  46. - traefik.enable=true
  47. - traefik.http.routers.netmaker-api.entrypoints=websecure
  48. - traefik.http.routers.netmaker-api.rule=Host(`api.NETMAKER_BASE_DOMAIN`)
  49. - traefik.http.routers.netmaker-api.service=netmaker-api
  50. - traefik.http.services.netmaker-api.loadbalancer.server.port=8081
  51. netmaker-ui:
  52. container_name: netmaker-ui
  53. image: gravitl/netmaker-ui:v0.14.5
  54. depends_on:
  55. - netmaker
  56. links:
  57. - "netmaker:api"
  58. restart: always
  59. environment:
  60. BACKEND_URL: "https://api.NETMAKER_BASE_DOMAIN"
  61. expose:
  62. - "80"
  63. labels:
  64. - traefik.enable=true
  65. - traefik.http.middlewares.nmui-security.headers.accessControlAllowOriginList=*.NETMAKER_BASE_DOMAIN
  66. - traefik.http.middlewares.nmui-security.headers.stsSeconds=31536000
  67. - traefik.http.middlewares.nmui-security.headers.browserXssFilter=true
  68. - traefik.http.middlewares.nmui-security.headers.customFrameOptionsValue=SAMEORIGIN
  69. - traefik.http.middlewares.nmui-security.headers.customResponseHeaders.X-Robots-Tag=none
  70. - traefik.http.middlewares.nmui-security.headers.customResponseHeaders.Server= # Remove the server name
  71. - traefik.http.routers.netmaker-ui.entrypoints=websecure
  72. - traefik.http.routers.netmaker-ui.middlewares=nmui-security@docker
  73. - traefik.http.routers.netmaker-ui.rule=Host(`dashboard.NETMAKER_BASE_DOMAIN`)
  74. - traefik.http.routers.netmaker-ui.service=netmaker-ui
  75. - traefik.http.services.netmaker-ui.loadbalancer.server.port=80
  76. coredns:
  77. container_name: coredns
  78. image: coredns/coredns
  79. command: -conf /root/dnsconfig/Corefile
  80. depends_on:
  81. - netmaker
  82. restart: always
  83. volumes:
  84. - dnsconfig:/root/dnsconfig
  85. traefik:
  86. image: traefik:v2.6
  87. container_name: traefik
  88. command:
  89. - "--certificatesresolvers.http.acme.email=YOUR_EMAIL"
  90. - "--certificatesresolvers.http.acme.storage=/letsencrypt/acme.json"
  91. - "--certificatesresolvers.http.acme.tlschallenge=true"
  92. - "--entrypoints.websecure.address=:443"
  93. - "--entrypoints.websecure.http.tls=true"
  94. - "--entrypoints.websecure.http.tls.certResolver=http"
  95. - "--log.level=INFO"
  96. - "--providers.docker=true"
  97. - "--providers.docker.exposedByDefault=false"
  98. - "--serverstransport.insecureskipverify=true"
  99. restart: always
  100. volumes:
  101. - /var/run/docker.sock:/var/run/docker.sock:ro
  102. - traefik_certs:/letsencrypt
  103. ports:
  104. - "443:443"
  105. mq:
  106. container_name: mq
  107. image: eclipse-mosquitto:2.0.11-openssl
  108. depends_on:
  109. - netmaker
  110. restart: unless-stopped
  111. volumes:
  112. - /root/mosquitto.conf:/mosquitto/config/mosquitto.conf
  113. - mosquitto_data:/mosquitto/data
  114. - mosquitto_logs:/mosquitto/log
  115. - shared_certs:/mosquitto/certs
  116. expose:
  117. - "8883"
  118. labels:
  119. - traefik.enable=true
  120. - traefik.tcp.routers.mqtts.rule=HostSNI(`broker.NETMAKER_BASE_DOMAIN`)
  121. - traefik.tcp.routers.mqtts.tls.passthrough=true
  122. - traefik.tcp.services.mqtts-svc.loadbalancer.server.port=8883
  123. - traefik.tcp.routers.mqtts.service=mqtts-svc
  124. - traefik.tcp.routers.mqtts.entrypoints=websecure
  125. volumes:
  126. traefik_certs: {}
  127. shared_certs: {}
  128. sqldata: {}
  129. dnsconfig: {}
  130. mosquitto_data: {}
  131. mosquitto_logs: {}