Skip to content

Instantly share code, notes, and snippets.

@skoky
Forked from Wavefarer42/docker-compose.yml
Last active January 23, 2021 07:53
Show Gist options
  • Save skoky/dc320853911bb847225b79f09d6b43cb to your computer and use it in GitHub Desktop.
Save skoky/dc320853911bb847225b79f09d6b43cb to your computer and use it in GitHub Desktop.
MongoDB Charts (docker-compose)
version: "3.3"
services:
mongo:
image: mongo:4.1.1
restart: on-failure
command: --wiredTigerCacheSizeGB 3
ports:
# Charts db is available under port 27018 to not block the default mongo port
- "8082:8081"
- "27018:27017"
volumes:
- ./data/db:/data/db
charts:
image: quay.io/mongodb/charts:v0.11.0
hostname: charts
depends_on:
- mongo
ports:
# host:container port mapping. If you want MongoDB Charts to be
# reachable on a different port on the docker host, change this
# to <port>:80, e.g. 8888:80.
- 80:80
- 443:443
volumes:
- ./data/keys:/mongodb-charts/volumes/keys
- ./data/logs:/mongodb-charts/volumes/logs
- ./data/db-certs:/mongodb-charts/volumes/db-certs
- ./data/web-certs:/mongodb-charts/volumes/web-certs
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: "on"
# 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://172.17.0.1:27018
networks:
- backend
networks:
backend:
volumes:
keys:
logs:
db-certs:
web-certs:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment