From 4d0a0ce05dd4ec678ca6153ea3185a5148e8c648 Mon Sep 17 00:00:00 2001 From: sickprodigy Date: Fri, 12 Dec 2025 17:38:26 -0500 Subject: [PATCH] feat: add MongoDB and Mongo Express services to docker-compose configuration --- docker-compose/mongodb/docker-compose.yml | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docker-compose/mongodb/docker-compose.yml diff --git a/docker-compose/mongodb/docker-compose.yml b/docker-compose/mongodb/docker-compose.yml new file mode 100644 index 0000000..0bdba31 --- /dev/null +++ b/docker-compose/mongodb/docker-compose.yml @@ -0,0 +1,44 @@ +# Use root/example as user/password credentials +version: '3.1' +services: + mongo-db: + image: mongo + container_name: mongo-db + restart: always + environment: + UID: 1000 + GID: 1006 + MONGO_INITDB_ROOT_USERNAME: yourusername + MONGO_INITDB_ROOT_PASSWORD: ChangeMe123! + volumes: + - /docker-containers/mongodb/db:/data/db + - /docker-containers/mongodb/configdb:/data/configdb + - /docker-containers/mongodb/backup:/data/sickbackup + stdin_open: true + tty: true + networks: + homelab: # Specifying the network to join, simple way + aliases: + - mongo # how to add multiple aliases + - mongo-db + - mongodb + + mongo-express: + image: mongo-express + restart: always + ports: + - 8081:8081 + environment: + ME_CONFIG_MONGODB_ADMINUSERNAME: yourusername + ME_CONFIG_MONGODB_ADMINPASSWORD: ChangeMe123! + ME_CONFIG_MONGODB_URL: mongodb://yourusername:ChangeMe123!@mongo:27017/ + ME_CONFIG_BASICAUTH_USERNAME: yourusername + ME_CONFIG_BASICAUTH_PASSWORD: ChangeMe123 + networks: + - homelab # Specifying the network to join, simple way + +networks: # I don't know why but you have to specify the network 2x. In service, and in this tag area.. +# some-network: + homelab: # Sub-section, any network name or 'default' to edit default one created +# name: homelab # Networks can also be given a custom name, not needed if existing + external: true # This option causes compose to join the above network instead of making a _default one \ No newline at end of file