docker-compose.reference.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. version: "3.4"
  2. services:
  3. netmaker: # The Primary Server for running Netmaker
  4. container_name: netmaker
  5. <<<<<<< HEAD
  6. image: gravitl/netmaker:v0.17.0
  7. =======
  8. image: gravitl/netmaker:v0.16.3
  9. >>>>>>> 407c6ed20a427153acb4901db7e61d3016823cc4
  10. cap_add:
  11. - NET_ADMIN
  12. - NET_RAW
  13. - SYS_MODULE
  14. sysctls:
  15. - net.ipv4.ip_forward=1
  16. - net.ipv4.conf.all.src_valid_mark=1
  17. - net.ipv6.conf.all.disable_ipv6=0
  18. - net.ipv6.conf.all.forwarding=1
  19. restart: always
  20. volumes: # Volume mounts necessary for sql, coredns, and mqtt
  21. - dnsconfig:/root/config/dnsconfig
  22. - sqldata:/root/data
  23. - shared_certs:/etc/netmaker
  24. environment: # Necessary capabilities to set iptables when running in container
  25. SERVER_NAME: "broker.NETMAKER_BASE_DOMAIN" # The domain/host IP indicating the mq broker address
  26. SERVER_HOST: "SERVER_PUBLIC_IP" # Set to public IP of machine.
  27. SERVER_HTTP_HOST: "api.NETMAKER_BASE_DOMAIN" # Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks.
  28. SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
  29. COREDNS_ADDR: "SERVER_PUBLIC_IP" # Address of the CoreDNS server. Defaults to SERVER_HOST
  30. DNS_MODE: "on" # Enables DNS Mode, meaning all nodes will set hosts file for private dns settings.
  31. API_PORT: "8081" # The HTTP API port for Netmaker. Used for API calls / communication from front end. If changed, need to change port of BACKEND_URL for netmaker-ui.
  32. CLIENT_MODE: "on" # Depricated. CLIENT_MODE should always be ON
  33. REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
  34. DISABLE_REMOTE_IP_CHECK: "off" # If turned "on", Server will not set Host based on remote IP check. This is already overridden if SERVER_HOST is set. Turned "off" by default.
  35. TELEMETRY: "on" # Whether or not to send telemetry data to help improve Netmaker. Switch to "off" to opt out of sending telemetry.
  36. RCE: "off" # Enables setting PostUp and PostDown (arbitrary commands) on nodes from the server. Off by default.
  37. MASTER_KEY: "REPLACE_MASTER_KEY" # The admin master key for accessing the API. Change this in any production installation.
  38. CORS_ALLOWED_ORIGIN: "*" # The "allowed origin" for API requests. Change to restrict where API requests can come from.
  39. DISPLAY_KEYS: "on" # Show keys permanently in UI (until deleted) as opposed to 1-time display.
  40. DATABASE: "sqlite" # Database to use - sqlite, postgres, or rqlite
  41. NODE_ID: "netmaker-server-1" # used for HA - identifies this server vs other servers
  42. MQ_HOST: "mq" # the address of the mq server. If running from docker compose it will be "mq". Otherwise, need to input address. If using "host networking", it will find and detect the IP of the mq container.
  43. MQ_SERVER_PORT: "1883" # the reachable port of MQ by the server - change if internal MQ port changes (or use external port if MQ is not on the same machine)
  44. MQ_PORT: "443" # the reachable port of MQ - change if external MQ port changes (port on proxy, not necessarily the one exposed in docker-compose)
  45. HOST_NETWORK: "off" # whether or not host networking is turned on. Only turn on if configured for host networking (see docker-compose.hostnetwork.yml). Will set host-level settings like iptables.
  46. VERBOSITY: "1" # logging verbosity level - 1, 2, or 3
  47. MANAGE_IPTABLES: "on" # deprecated
  48. PORT_FORWARD_SERVICES: "dns" # decide which services to port forward ("dns","ssh", or "mq")
  49. # this section is for OAuth
  50. AUTH_PROVIDER: "" # "<azure-ad|github|google|oidc>"
  51. CLIENT_ID: "" # "<client id of your oauth provider>"
  52. CLIENT_SECRET: "" # "<client secret of your oauth provider>"
  53. FRONTEND_URL: "" # "https://dashboard.<netmaker base domain>"
  54. AZURE_TENANT: "" # "<only for azure, you may optionally specify the tenant for the OAuth>"
  55. OIDC_ISSUER: "" # https://oidc.yourprovider.com - URL of oidc provider
  56. ports:
  57. - "51821-51830:51821-51830/udp" # wireguard ports
  58. netmaker-ui: # The Netmaker UI Component
  59. container_name: netmaker-ui
  60. <<<<<<< HEAD
  61. image: gravitl/netmaker-ui:v0.17.0
  62. =======
  63. image: gravitl/netmaker-ui:v0.16.3
  64. >>>>>>> 407c6ed20a427153acb4901db7e61d3016823cc4
  65. depends_on:
  66. - netmaker
  67. links:
  68. - "netmaker:api"
  69. restart: always
  70. environment:
  71. BACKEND_URL: "https://api.NETMAKER_BASE_DOMAIN" # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
  72. caddy: # The reverse proxy that manages traffic for Netmaker
  73. image: caddy:2.6.2
  74. container_name: caddy
  75. restart: unless-stopped
  76. volumes:
  77. - /root/Caddyfile:/etc/caddy/Caddyfile # Config file for Caddy
  78. - caddy_data:/data
  79. - caddy_conf:/config
  80. ports:
  81. - "80:80"
  82. - "443:443"
  83. coredns: # The DNS Server. CoreDNS can be removed unless doing special advanced use cases
  84. container_name: coredns
  85. image: coredns/coredns
  86. command: -conf /root/dnsconfig/Corefile
  87. depends_on:
  88. - netmaker
  89. restart: always
  90. volumes:
  91. - dnsconfig:/root/dnsconfig
  92. <<<<<<< HEAD
  93. =======
  94. traefik: # the default proxy - can be replaced with caddy or nginx, but requires careful configuration
  95. image: traefik:v2.9
  96. container_name: traefik
  97. command:
  98. - "--certificatesresolvers.http.acme.email=YOUR_EMAIL"
  99. - "--certificatesresolvers.http.acme.storage=/letsencrypt/acme.json"
  100. - "--certificatesresolvers.http.acme.tlschallenge=true"
  101. - "--entrypoints.websecure.address=:443"
  102. - "--entrypoints.websecure.http.tls=true"
  103. - "--entrypoints.websecure.http.tls.certResolver=http"
  104. - "--log.level=INFO"
  105. - "--providers.docker=true"
  106. - "--providers.docker.exposedByDefault=false"
  107. - "--serverstransport.insecureskipverify=true"
  108. restart: always
  109. volumes:
  110. - /var/run/docker.sock:/var/run/docker.sock:ro
  111. - traefik_certs:/letsencrypt
  112. ports:
  113. - "443:443"
  114. >>>>>>> 407c6ed20a427153acb4901db7e61d3016823cc4
  115. mq: # the MQTT broker for netmaker
  116. container_name: mq
  117. image: eclipse-mosquitto:2.0.15-openssl
  118. depends_on:
  119. - netmaker
  120. restart: unless-stopped
  121. volumes:
  122. - /root/mosquitto.conf:/mosquitto/config/mosquitto.conf # need to pull conf file from github before running (under docker/mosquitto.conf)
  123. - mosquitto_data:/mosquitto/data
  124. - mosquitto_logs:/mosquitto/log
  125. - shared_certs:/mosquitto/certs
  126. <<<<<<< HEAD
  127. ports:
  128. - "1883:1883"
  129. - "8883:8883"
  130. =======
  131. expose:
  132. - "8883"
  133. labels:
  134. - traefik.enable=true
  135. - traefik.http.routers.mqtt_websocket.rule=Host(`broker.NETMAKER_BASE_DOMAIN`)
  136. - traefik.http.routers.mqtt_websocket.entrypoints=websecure
  137. - traefik.http.routers.mqtt_websocket.tls.passthrough=true
  138. - traefik.http.services.mqtts-svc.loadbalancer.server.port=8883
  139. - traefik.http.routers.mqtt_websocket.service=mqtts-svc
  140. >>>>>>> 407c6ed20a427153acb4901db7e61d3016823cc4
  141. volumes:
  142. caddy_data: {} # runtime data for caddy
  143. caddy_conf: {} # configuration file for Caddy
  144. shared_certs: {} # netmaker certs generated for MQ comms - used by nodes/servers
  145. sqldata: {} # storage for embedded sqlite
  146. dnsconfig: {} # storage for coredns
  147. mosquitto_data: {} # storage for mqtt data
  148. mosquitto_logs: {} # storage for mqtt logs