docker-compose.reference.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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: on-failure
  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. NETCLIENT_AUTO_UPDATE: "enabled" # Enable auto update of netclient ? ENUM:- enabled,disabled | default: enabled
  17. SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
  18. COREDNS_ADDR: "SERVER_PUBLIC_IP" # Address of the CoreDNS server. Defaults to SERVER_HOST
  19. DNS_MODE: "on" # Enables DNS Mode, meaning all nodes will set hosts file for private dns settings.
  20. 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.
  21. REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
  22. 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.
  23. TELEMETRY: "on" # Whether or not to send telemetry data to help improve Netmaker. Switch to "off" to opt out of sending telemetry.
  24. MASTER_KEY: "REPLACE_MASTER_KEY" # The admin master key for accessing the API. Change this in any production installation.
  25. 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
  26. DISPLAY_KEYS: "on" # Show keys permanently in UI (until deleted) as opposed to 1-time display.
  27. DATABASE: "sqlite" # Database to use - sqlite, postgres, or rqlite
  28. NODE_ID: "netmaker-server-1" # used for HA - identifies this server vs other servers
  29. 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.
  30. MQ_USERNAME: "REPLACE_MQ_USERNAME" # the username to set for MQ access
  31. MQ_PASSWORD: "REPLACE_MQ_PASSWORD" # the password to set for MQ access
  32. STUN_PORT: "3478" # the reachable port of STUN on the server
  33. VERBOSITY: "1" # logging verbosity level - 1, 2, or 3
  34. # this section is for OAuth
  35. AUTH_PROVIDER: "" # "<azure-ad|github|google|oidc>"
  36. CLIENT_ID: "" # "<client id of your oauth provider>"
  37. CLIENT_SECRET: "" # "<client secret of your oauth provider>"
  38. FRONTEND_URL: "" # "https://dashboard.<netmaker base domain>"
  39. AZURE_TENANT: "" # "<only for azure, you may optionally specify the tenant for the OAuth>"
  40. OIDC_ISSUER: "" # https://oidc.yourprovider.com - URL of oidc provider
  41. DEFAULT_PROXY_MODE: "off" # 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
  42. TURN_SERVER_HOST: "turn.NETMAKER_BASE_DOMAIN" # domain for your turn server
  43. TURN_SERVER_API_HOST: "https://turnapi.NETMAKER_BASE_DOMAIN" # domain of the turn api server
  44. TURN_PORT: "3479" # port to access turn server
  45. TURN_USERNAME: "REPLACE_TURN_USERNAME" # the username to set for turn api access
  46. TURN_PASSWORD: "REPLACE_TURN_PASSWORD" # the password to set for turn api access
  47. USE_TURN: "true" #config for using turn, accepts either true/false
  48. ports:
  49. - "3478:3478/udp" # the stun port
  50. netmaker-ui: # The Netmaker UI Component
  51. container_name: netmaker-ui
  52. image: gravitl/netmaker-ui:REPLACE_UI_IMAGE_TAG
  53. depends_on:
  54. - netmaker
  55. links:
  56. - "netmaker:api"
  57. restart: always
  58. environment:
  59. 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
  60. caddy: # The reverse proxy that manages traffic for Netmaker
  61. image: caddy:2.6.2
  62. container_name: caddy
  63. restart: unless-stopped
  64. volumes:
  65. - /root/Caddyfile:/etc/caddy/Caddyfile # Config file for Caddy
  66. - caddy_data:/data
  67. - caddy_conf:/config
  68. ports:
  69. - "80:80"
  70. - "443:443"
  71. coredns: # The DNS Server. CoreDNS can be removed unless doing special advanced use cases
  72. container_name: coredns
  73. image: coredns/coredns
  74. command: -conf /root/dnsconfig/Corefile
  75. depends_on:
  76. - netmaker
  77. restart: always
  78. volumes:
  79. - dnsconfig:/root/dnsconfig
  80. mq: # the mqtt broker for netmaker
  81. container_name: mq
  82. image: eclipse-mosquitto:2.0.15-openssl
  83. depends_on:
  84. - netmaker
  85. restart: unless-stopped
  86. command: ["/mosquitto/config/wait.sh"]
  87. environment:
  88. MQ_PASSWORD: "REPLACE_MQ_PASSWORD" # must be same value as in netmaker env
  89. MQ_USERNAME: "REPLACE_MQ_USERNAME" # must be same value as in netmaker env
  90. volumes:
  91. - /root/mosquitto.conf:/mosquitto/config/mosquitto.conf
  92. - /root/wait.sh:/mosquitto/config/wait.sh
  93. - mosquitto_logs:/mosquitto/log
  94. ports:
  95. - "1883:1883"
  96. - "8883:8883"
  97. turn:
  98. container_name: turn
  99. image: gravitl/turnserver:v1.0.0
  100. network_mode: "host"
  101. volumes:
  102. - turn_server:/etc/config
  103. environment:
  104. DEBUG_MODE: "off"
  105. VERBOSITY: "1"
  106. TURN_PORT: "3479"
  107. TURN_API_PORT: "8089"
  108. CORS_ALLOWED_ORIGIN: "*"
  109. TURN_SERVER_HOST: "turn.NETMAKER_BASE_DOMAIN"
  110. USERNAME: "REPLACE_TURN_USERNAME"
  111. PASSWORD: "REPLACE_TURN_PASSWORD"
  112. USE_TURN: "true"
  113. volumes:
  114. caddy_data: {} # runtime data for caddy
  115. caddy_conf: {} # configuration file for Caddy
  116. shared_certs: {} # netmaker certs generated for MQ comms - used by nodes/servers
  117. sqldata: {} # storage for embedded sqlite
  118. dnsconfig: {} # storage for coredns
  119. mosquitto_logs: {} # storage for mqtt logs
  120. turn_server: {}