Mongo charts is a nice visualizer for MongoDB. Its young and I desire much more functionality but it’s a nice quick and dirty. I suspect easier than building a Pandas or Matplotlib visualizer but I also suspect there are things that do this much better like Grafana. Anyway, here is how to set the darn thing up without a swarm which is the documented way from mongo. This took some tinkering to get right. Note that this creates persistent volumes in directories rather than using the docker volume facility.
I have exposed this instance with Traefik but obfuscated that part as well as internal details.
I also recommend persisting your mongo data to folders if you’re running it in containers. Either method below works
docker run -blah -blah -blah -v host:container banana_hammock:latest
volumes: - host:container
version: "3.3" services: charts: image: quay.io/mongodb/charts:v0.12.0 container_name: charts # hostname: charts ports: # host:container port mapping. If you want MongoDB Charts to be # reachable on a different port on the docker host, change this # to :80, e.g. 8888:80. - 80:80 volumes: - /yourstuff/keys:/mongodb-charts/volumes/keys - /yourstuff/mongodb-charts/data/logs:/mongodb-charts/volumes/logs - /yourstuff/ongodb-charts/data/db-certs:/mongodb-charts/volumes/db-certs - /yourstuff/mongodb-charts/data/web-certs:/mongodb-charts/volumes/web-certs - /yourstuff/mongodb-charts/charts-mongodb-uri:/run/secrets/charts-mongodb-uri environment: # The presence of following 2 environment variables will enable HTTPS on Charts server. # All HTTP requests will be redirected to HTTPS as well. # To enable HTTPS, upload your certificate and key file to the web-certs volume, # uncomment the following lines and replace with the names of your certificate and key file. # CHARTS_HTTPS_CERTIFICATE_FILE: charts-https.crt # CHARTS_HTTPS_CERTIFICATE_KEY_FILE: charts-https.key # This environment variable controls the built-in support widget and # metrics collection in MongoDB Charts. To disable both, set the value # to "off". The default is "on". CHARTS_SUPPORT_WIDGET_AND_METRICS: "off" # Directory where you can upload SSL certificates (.pem format) which # should be considered trusted self-signed or root certificates when # Charts is accessing MongoDB servers with ?ssl=true # SSL_CERT_DIR: /mongodb-charts/volumes/db-certs CHARTS_MONGODB_URI: "mongodb://:@/admin" networks: - net1 - net2 labels: - "traefik.enable=true" - "traefik.frontend.rule=Host:banana.hammock.com" - "traefik.backend=banana" - "traefik.port=80" - "traefik.docker.network=net1" - "traefik.frontend.headers.SSLRedirect=true" - "traefik.frontend.headers.STSSeconds=315360000" - "traefik.frontend.headers.browserXSSFilter=true" - "traefik.frontend.headers.contentTypeNosniff=true" - "traefik.frontend.headers.forceSTSHeader=true" - "traefik.frontend.headers.SSLHost=lamkerad.com" - "traefik.frontend.headers.STSIncludeSubdomains=true" - "traefik.frontend.headers.STSPreload=true" - "traefik.frontend.headers.frameDeny=true" # links: # - mongo_mongo_1 networks: net2: external: name: net2 net1: external: true