compose.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. services:
  2. mongodb:
  3. image: mongo:latest
  4. container_name: mongodb
  5. restart: always
  6. expose:
  7. - 27017
  8. networks:
  9. - dokploy-network
  10. volumes:
  11. - mongodb-data:/data/db
  12. meshcentral:
  13. image: ghcr.io/ylianst/meshcentral:latest
  14. container_name: meshcentral
  15. restart: always
  16. networks:
  17. - dokploy-network
  18. environment:
  19. - USE_MONGODB=true
  20. - MONGO_URL=mongodb://mongodb:27017/meshcentral
  21. entrypoint:
  22. - /bin/bash
  23. - -c
  24. - |
  25. echo "Generating manual config.json for Coolify..."
  26. mkdir -p /opt/meshcentral/meshcentral-data
  27. cat <<EOF > /opt/meshcentral/meshcentral-data/config.json
  28. {
  29. "settings": {
  30. "cert": "desk.beyhan.gen.tr",
  31. "port": 80,
  32. "redirPort": 0,
  33. "aliasPort": 443,
  34. "tlsOffload": true,
  35. "trustedProxy": true,
  36. "allowedOrigin": true,
  37. "mongoDb": "mongodb://mongodb:27017/meshcentral"
  38. },
  39. "domains": {
  40. "": {
  41. "certUrl": "https://desk.beyhan.gen.tr:443"
  42. }
  43. }
  44. }
  45. EOF
  46. echo "Starting MeshCentral with custom config..."
  47. exec node /opt/meshcentral/meshcentral/meshcentral --configfile /opt/meshcentral/meshcentral-data/config.json
  48. volumes:
  49. - meshcentral-data:/opt/meshcentral/meshcentral-data
  50. - meshcentral-files:/opt/meshcentral/meshcentral-files
  51. - meshcentral-web:/opt/meshcentral/meshcentral-web
  52. - meshcentral-backups:/opt/meshcentral/meshcentral-backups
  53. depends_on:
  54. - mongodb
  55. volumes:
  56. mongodb-data:
  57. meshcentral-data:
  58. meshcentral-files:
  59. meshcentral-web:
  60. meshcentral-backups:
  61. networks:
  62. dokploy-network:
  63. external: true