docker-compose.reference.yml 5.2 KB

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