compose.yaml 1.6 KB

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