docker-compose.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. version: "3.4"
  2. services:
  3. netmaker:
  4. container_name: netmaker
  5. image: gravitl/netmaker:$SERVER_IMAGE_TAG
  6. env_file: ./netmaker.env
  7. restart: on-failure
  8. volumes:
  9. - dnsconfig:/root/config/dnsconfig
  10. - sqldata:/root/data
  11. environment:
  12. # config-dependant vars
  13. - STUN_LIST=stun.${NM_DOMAIN}:${STUN_PORT},stun1.netmaker.io:3478,stun2.netmaker.io:3478,stun1.l.google.com:19302,stun2.l.google.com:19302
  14. # The domain/host IP indicating the mq broker address
  15. - BROKER_ENDPOINT=wss://broker.${NM_DOMAIN}
  16. # The base domain of netmaker
  17. - SERVER_NAME=${NM_DOMAIN}
  18. - SERVER_API_CONN_STRING=api.${NM_DOMAIN}:443
  19. # Address of the CoreDNS server. Defaults to SERVER_HOST
  20. - COREDNS_ADDR=${SERVER_HOST}
  21. # Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks.
  22. - SERVER_HTTP_HOST=api.${NM_DOMAIN}
  23. # domain for your turn server
  24. - TURN_SERVER_HOST=turn.${NM_DOMAIN}
  25. # domain of the turn api server
  26. - TURN_SERVER_API_HOST=https://turnapi.${NM_DOMAIN}
  27. ports:
  28. - "3478:3478/udp"
  29. netmaker-ui:
  30. container_name: netmaker-ui
  31. image: gravitl/netmaker-ui:$UI_IMAGE_TAG
  32. env_file: ./netmaker.env
  33. environment:
  34. # config-dependant vars
  35. # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
  36. BACKEND_URL: "https://api.${NM_DOMAIN}"
  37. depends_on:
  38. - netmaker
  39. links:
  40. - "netmaker:api"
  41. restart: always
  42. caddy:
  43. image: caddy:2.6.2
  44. container_name: caddy
  45. env_file: ./netmaker.env
  46. restart: unless-stopped
  47. extra_hosts:
  48. - "host.docker.internal:host-gateway"
  49. volumes:
  50. - ./Caddyfile:/etc/caddy/Caddyfile
  51. - ./certs:/root/certs
  52. - caddy_data:/data
  53. - caddy_conf:/config
  54. ports:
  55. - "80:80"
  56. - "443:443"
  57. coredns:
  58. container_name: coredns
  59. image: coredns/coredns
  60. command: -conf /root/dnsconfig/Corefile
  61. env_file: ./netmaker.env
  62. depends_on:
  63. - netmaker
  64. restart: always
  65. volumes:
  66. - dnsconfig:/root/dnsconfig
  67. mq:
  68. container_name: mq
  69. image: eclipse-mosquitto:2.0.15-openssl
  70. env_file: ./netmaker.env
  71. depends_on:
  72. - netmaker
  73. restart: unless-stopped
  74. command: [ "/mosquitto/config/wait.sh" ]
  75. volumes:
  76. - ./mosquitto.conf:/mosquitto/config/mosquitto.conf
  77. - ./wait.sh:/mosquitto/config/wait.sh
  78. - mosquitto_logs:/mosquitto/log
  79. - mosquitto_data:/mosquitto/data
  80. turn:
  81. container_name: turn
  82. image: gravitl/turnserver:v1.0.0
  83. env_file: ./netmaker.env
  84. environment:
  85. # config-dependant vars
  86. - USERNAME=${TURN_USERNAME}
  87. - PASSWORD=${TURN_PASSWORD}
  88. # domain for your turn server
  89. - TURN_SERVER_HOST=turn.${NM_DOMAIN}
  90. network_mode: "host"
  91. volumes:
  92. - turn_server:/etc/config
  93. volumes:
  94. caddy_data: { } # runtime data for caddy
  95. caddy_conf: { } # configuration file for Caddy
  96. sqldata: { }
  97. dnsconfig: { } # storage for coredns
  98. mosquitto_logs: { } # storage for mqtt logs
  99. mosquitto_data: { } # storage for mqtt data
  100. turn_server: { }