docker-compose.reference.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. version: "3.4"
  2. services:
  3. netmaker: # The Primary Server for running Netmaker
  4. container_name: netmaker
  5. image: gravitl/netmaker:v0.17.0
  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: # Volume mounts necessary for sql, coredns, and mqtt
  17. - dnsconfig:/root/config/dnsconfig
  18. - sqldata:/root/data
  19. - shared_certs:/etc/netmaker
  20. environment: # Necessary capabilities to set iptables when running in container
  21. SERVER_NAME: "broker.NETMAKER_BASE_DOMAIN" # The domain/host IP indicating the mq broker address
  22. SERVER_HOST: "SERVER_PUBLIC_IP" # Set to public IP of machine.
  23. SERVER_HTTP_HOST: "api.NETMAKER_BASE_DOMAIN" # Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks.
  24. SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
  25. COREDNS_ADDR: "SERVER_PUBLIC_IP" # Address of the CoreDNS server. Defaults to SERVER_HOST
  26. DNS_MODE: "on" # Enables DNS Mode, meaning all nodes will set hosts file for private dns settings.
  27. 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.
  28. CLIENT_MODE: "on" # Depricated. CLIENT_MODE should always be ON
  29. REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
  30. 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.
  31. TELEMETRY: "on" # Whether or not to send telemetry data to help improve Netmaker. Switch to "off" to opt out of sending telemetry.
  32. RCE: "off" # Enables setting PostUp and PostDown (arbitrary commands) on nodes from the server. Off by default.
  33. MASTER_KEY: "REPLACE_MASTER_KEY" # The admin master key for accessing the API. Change this in any production installation.
  34. CORS_ALLOWED_ORIGIN: "*" # The "allowed origin" for API requests. Change to restrict where API requests can come from.
  35. DISPLAY_KEYS: "on" # Show keys permanently in UI (until deleted) as opposed to 1-time display.
  36. DATABASE: "sqlite" # Database to use - sqlite, postgres, or rqlite
  37. NODE_ID: "netmaker-server-1" # used for HA - identifies this server vs other servers
  38. 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.
  39. 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)
  40. 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)
  41. 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.
  42. VERBOSITY: "1" # logging verbosity level - 1, 2, or 3
  43. MANAGE_IPTABLES: "on" # deprecated
  44. PORT_FORWARD_SERVICES: "dns" # decide which services to port forward ("dns","ssh", or "mq")
  45. # this section is for OAuth
  46. AUTH_PROVIDER: "" # "<azure-ad|github|google|oidc>"
  47. CLIENT_ID: "" # "<client id of your oauth provider>"
  48. CLIENT_SECRET: "" # "<client secret of your oauth provider>"
  49. FRONTEND_URL: "" # "https://dashboard.<netmaker base domain>"
  50. AZURE_TENANT: "" # "<only for azure, you may optionally specify the tenant for the OAuth>"
  51. OIDC_ISSUER: "" # https://oidc.yourprovider.com - URL of oidc provider
  52. ports:
  53. - "51821-51830:51821-51830/udp" # wireguard ports
  54. netmaker-ui: # The Netmaker UI Component
  55. container_name: netmaker-ui
  56. image: gravitl/netmaker-ui:v0.17.0
  57. depends_on:
  58. - netmaker
  59. links:
  60. - "netmaker:api"
  61. restart: always
  62. environment:
  63. 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
  64. caddy: # The reverse proxy that manages traffic for Netmaker
  65. image: caddy:2.6.2
  66. container_name: caddy
  67. restart: unless-stopped
  68. volumes:
  69. - /root/Caddyfile:/etc/caddy/Caddyfile # Config file for Caddy
  70. - caddy_data:/data
  71. - caddy_conf:/config
  72. ports:
  73. - "80:80"
  74. - "443:443"
  75. coredns: # The DNS Server. CoreDNS can be removed unless doing special advanced use cases
  76. container_name: coredns
  77. image: coredns/coredns
  78. command: -conf /root/dnsconfig/Corefile
  79. depends_on:
  80. - netmaker
  81. restart: always
  82. volumes:
  83. - dnsconfig:/root/dnsconfig
  84. mq: # the MQTT broker for netmaker
  85. container_name: mq
  86. image: eclipse-mosquitto:2.0.15-openssl
  87. depends_on:
  88. - netmaker
  89. restart: unless-stopped
  90. volumes:
  91. - /root/mosquitto.conf:/mosquitto/config/mosquitto.conf # need to pull conf file from github before running (under docker/mosquitto.conf)
  92. - mosquitto_data:/mosquitto/data
  93. - mosquitto_logs:/mosquitto/log
  94. - shared_certs:/mosquitto/certs
  95. ports:
  96. - "1883:1883"
  97. - "8883:8883"
  98. volumes:
  99. caddy_data: {} # runtime data for caddy
  100. caddy_conf: {} # configuration file for Caddy
  101. shared_certs: {} # netmaker certs generated for MQ comms - used by nodes/servers
  102. sqldata: {} # storage for embedded sqlite
  103. dnsconfig: {} # storage for coredns
  104. mosquitto_data: {} # storage for mqtt data
  105. mosquitto_logs: {} # storage for mqtt logs