In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces docker-compose how to build mongodb, mysql, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Let's take a look at the detailed method of building mongodb and mysql by docker-compose, as shown below:
Version: '3'services: mysqldbservice: image:' mysql:latest' restart: always container_name: mysqlcontainer volumes: -. / data:/var/lib/mysql -. / my.cnf:/etc/mysql/my.cnf -. / init:/docker-entrypoint-initdb.d/ ports:-3306 mysqldbservice 3306 # "Host port number: container port number" environment: MYSQL_ROOT_PASSWORD: "" MYSQL_USER:''# create a normal user MYSQL_PASSWORD:''# ordinary user password MYSQL_DATABASE:''# create a library mongodbservice: # image name If you do not write the version number, by default pull the latest version image: mongo:latest # Port Mapping ports: # Host Port: container Port-27017 ports 27017 # Container data Mount Persistent volumes: # Host directory: container directory: read and write permissions -. / mongo:/data/db:rw -. / configdb:/data/configdb:rw # set the environment variable environment:-TZ=Asia/Shanghai # Container name container_name: mongocontainer
My.cnf
[mysqld] pid-file = / var/run/mysqld/mysqld.pidsocket = / var/run/mysqld/mysqld.sockdatadir = / var/lib/mysqlsecure-file-priv= NULL# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0# Custom config should go hereafter read dedir / etc/mysql/conf.d/ Thank you for reading this article carefully. I hope the article "how to build mongodb and mysql in docker-compose" shared by the editor will be helpful to you. At the same time, I also hope that you will support and pay attention to the industry information channel, and more related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.