docker-compose.reference.yml 5.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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_NAME: "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. 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_PORT: "443" # the reachable port of MQ - change if external MQ port changes (port on proxy, not necessarily the one exposed in docker-compose)
  30. 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)
  31. MQ_USERNAME: "REPLACE_MQ_USERNAME" # the username to set for MQ access
  32. MQ_PASSWORD: "REPLACE_MQ_PASSWORD" # the password to set for MQ access
  33. STUN_PORT: "3478" # the reachable port of STUN on the server
  34. VERBOSITY: "1" # logging verbosity level - 1, 2, or 3
  35. # this section is for OAuth
  36. AUTH_PROVIDER: "" # "<azure-ad|github|google|oidc>"
  37. CLIENT_ID: "" # "<client id of your oauth provider>"
  38. CLIENT_SECRET: "" # "<client secret of your oauth provider>"
  39. FRONTEND_URL: "" # "https://dashboard.<netmaker base domain>"
  40. AZURE_TENANT: "" # "<only for azure, you may optionally specify the tenant for the OAuth>"
  41. OIDC_ISSUER: "" # https://oidc.yourprovider.com - URL of oidc provider
  42. ports:
  43. - "3478:3478/udp" # the stun port
  44. netmaker-ui: # The Netmaker UI Component
  45. container_name: netmaker-ui
  46. image: gravitl/netmaker-ui:REPLACE_UI_IMAGE_TAG
  47. depends_on:
  48. - netmaker
  49. links:
  50. - "netmaker:api"
  51. restart: always
  52. environment:
  53. 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
  54. caddy: # The reverse proxy that manages traffic for Netmaker
  55. image: caddy:2.6.2
  56. container_name: caddy
  57. restart: unless-stopped
  58. volumes:
  59. - /root/Caddyfile:/etc/caddy/Caddyfile # Config file for Caddy
  60. - caddy_data:/data
  61. - caddy_conf:/config
  62. ports:
  63. - "80:80"
  64. - "443:443"
  65. coredns: # The DNS Server. CoreDNS can be removed unless doing special advanced use cases
  66. container_name: coredns
  67. image: coredns/coredns
  68. command: -conf /root/dnsconfig/Corefile
  69. depends_on:
  70. - netmaker
  71. restart: always
  72. volumes:
  73. - dnsconfig:/root/dnsconfig
  74. mq: # the mqtt broker for netmaker
  75. container_name: mq
  76. image: eclipse-mosquitto:2.0.15-openssl
  77. depends_on:
  78. - netmaker
  79. restart: unless-stopped
  80. command: ["/mosquitto/config/wait.sh"]
  81. environment:
  82. MQ_PASSWORD: "REPLACE_MQ_PASSWORD" # must be same value as in netmaker env
  83. MQ_USERNAME: "REPLACE_MQ_USERNAME" # must be same value as in netmaker env
  84. volumes:
  85. - /root/mosquitto.conf:/mosquitto/config/mosquitto.conf
  86. - /root/wait.sh:/mosquitto/config/wait.sh
  87. - mosquitto_logs:/mosquitto/log
  88. ports:
  89. - "1883:1883"
  90. - "8883:8883"
  91. volumes:
  92. caddy_data: {} # runtime data for caddy
  93. caddy_conf: {} # configuration file for Caddy
  94. shared_certs: {} # netmaker certs generated for MQ comms - used by nodes/servers
  95. sqldata: {} # storage for embedded sqlite
  96. dnsconfig: {} # storage for coredns
  97. mosquitto_logs: {} # storage for mqtt logs