From 91545b508502859859cfeec09ac64b1d3dea3920 Mon Sep 17 00:00:00 2001 From: BryantHe Date: Thu, 3 Aug 2023 23:18:15 +0800 Subject: [PATCH] add mongodb yml --- docker-compose-mongodb.yml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docker-compose-mongodb.yml diff --git a/docker-compose-mongodb.yml b/docker-compose-mongodb.yml new file mode 100644 index 0000000..f8a4a47 --- /dev/null +++ b/docker-compose-mongodb.yml @@ -0,0 +1,40 @@ +version: "3" + +services: + mongodb: + image: mongo + hostname: mongodb + container_name: mongodb + restart: always + ports: + - 27017:27017 + volumes: + - mongodb_data:/data/db + environment: + - MONGO_INITDB_ROOT_USERNAME=admin + - MONGO_INITDB_ROOT_PASSWORD=mongodb27017 + networks: + mongodb_network: + mongo-express: + image: mongo-express + hostname: mongo-express + container_name: mongo-express + restart: always + ports: + - 8088:8081 + environment: + - ME_CONFIG_MONGODB_ADMINUSERNAME=admin + - ME_CONFIG_MONGODB_ADMINPASSWORD=mongodb27017 + - ME_CONFIG_MONGODB_SERVER=mongodb + networks: + mongodb_network: + +networks: + mongodb_network: + driver: bridge + +volumes: + mongodb_data: + driver: local + +