docker-compose.reference.yml 5.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. version: "3.4"
  2. services:
  3. netmaker: # The Primary Server for running Netmaker
  4. container_name: netmaker
  5. image: gravitl/netmaker:REPLACE_SERVER_IMAGE_TAG
  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. BROKER_ENDPOINT: "wss://broker.NETMAKER_BASE_DOMAIN" # The domain/host IP indicating the mq broker address
  13. SERVER_NAME: "NETMAKER_BASE_DOMAIN" # The base domain of netmaker
  14. SERVER_HOST: "SERVER_PUBLIC_IP" # Set to public IP of machine.
  15. SERVER_HTTP_HOST: "api.NETMAKER_BASE_DOMAIN" # Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks.
  16. SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
  17. COREDNS_ADDR: "SERVER_PUBLIC_IP" # Address of the CoreDNS server. Defaults to SERVER_HOST
  18. DNS_MODE: "on" # Enables DNS Mode, meaning all nodes will set hosts file for private dns settings.
  19. 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.
  20. REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
  21. 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.
  22. TELEMETRY: "on" # Whether or not to send telemetry data to help improve Netmaker. Switch to "off" to opt out of sending telemetry.
  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. SERVER_BROKER_ENDPOINT: ""ws://mq:1883"" # 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_USERNAME: "REPLACE_MQ_USERNAME" # the username to set for MQ access
  30. MQ_PASSWORD: "REPLACE_MQ_PASSWORD" # the password to set for MQ access
  31. STUN_PORT: "3478" # the reachable port of STUN on the server
  32. VERBOSITY: "1" # logging verbosity level - 1, 2, or 3
  33. # this section is for OAuth
  34. AUTH_PROVIDER: "" # "<azure-ad|github|google|oidc>"
  35. CLIENT_ID: "" # "<client id of your oauth provider>"
  36. CLIENT_SECRET: "" # "<client secret of your oauth provider>"
  37. FRONTEND_URL: "" # "https://dashboard.<netmaker base domain>"
  38. AZURE_TENANT: "" # "<only for azure, you may optionally specify the tenant for the OAuth>"
  39. OIDC_ISSUER: "" # https://oidc.yourprovider.com - URL of oidc provider
  40. DEFAULT_PROXY_MODE: "auto" # if ON, all new clients will enable proxy by default if OFF, all new clients will disable proxy by default, if AUTO, stick with the existing logic for NAT detection
  41. ports:
  42. - "3478:3478/udp" # the stun port
  43. netmaker-ui: # The Netmaker UI Component
  44. container_name: netmaker-ui
  45. image: gravitl/netmaker-ui:REPLACE_UI_IMAGE_TAG
  46. depends_on:
  47. - netmaker
  48. links:
  49. - "netmaker:api"
  50. restart: always
  51. environment:
  52. 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
  53. caddy: # The reverse proxy that manages traffic for Netmaker
  54. image: caddy:2.6.2
  55. container_name: caddy
  56. restart: unless-stopped
  57. volumes:
  58. - /root/Caddyfile:/etc/caddy/Caddyfile # Config file for Caddy
  59. - caddy_data:/data
  60. - caddy_conf:/config
  61. ports:
  62. - "80:80"
  63. - "443:443"
  64. coredns: # The DNS Server. CoreDNS can be removed unless doing special advanced use cases
  65. container_name: coredns
  66. image: coredns/coredns
  67. command: -conf /root/dnsconfig/Corefile
  68. depends_on:
  69. - netmaker
  70. restart: always
  71. volumes:
  72. - dnsconfig:/root/dnsconfig
  73. mq: # the mqtt broker for netmaker
  74. container_name: mq
  75. image: eclipse-mosquitto:2.0.15-openssl
  76. depends_on:
  77. - netmaker
  78. restart: unless-stopped
  79. command: ["/mosquitto/config/wait.sh"]
  80. environment:
  81. MQ_PASSWORD: "REPLACE_MQ_PASSWORD" # must be same value as in netmaker env
  82. MQ_USERNAME: "REPLACE_MQ_USERNAME" # must be same value as in netmaker env
  83. volumes:
  84. - /root/mosquitto.conf:/mosquitto/config/mosquitto.conf
  85. - /root/wait.sh:/mosquitto/config/wait.sh
  86. - mosquitto_logs:/mosquitto/log
  87. ports:
  88. - "1883:1883"
  89. - "8883:8883"
  90. volumes:
  91. caddy_data: {} # runtime data for caddy
  92. caddy_conf: {} # configuration file for Caddy
  93. shared_certs: {} # netmaker certs generated for MQ comms - used by nodes/servers
  94. sqldata: {} # storage for embedded sqlite
  95. dnsconfig: {} # storage for coredns
  96. mosquitto_logs: {} # storage for mqtt logs