Let's take a look at the detailed method of building mongodb and mysql with docker-compose. The content is as follows: 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:3306 #“Host port number: container port number” environment: MYSQL_ROOT_PASSWORD: "" MYSQL_USER: '' # Create a common user MYSQL_PASSWORD: '' # Common user password MYSQL_DATABASE: '' # Create a library mongodbservice: # Image name. If the version number is not specified, the latest version will be pulled by default. image: mongo:latest # Port mapping ports: # Host port: container port - 27017:27017 # Container data mount, persistent volumes: # Host directory: container directory: read and write permissions - ./mongo:/data/db:rw - ./configdb:/data/configdb:rw # Set environment variables: - TZ=Asia/Shanghai #Container name container_name: mongocontainer my.cnf [mysqld] pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock datadir = /var/lib/mysql secure-file-priv= NULL # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Custom config should go here !includedir /etc/mysql/conf.d/ This is the end of this article about using docker-compose to build mongodb and mysql. For more information about using docker-compose to build mongodb, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: How to use crontab to backup MySQL database regularly in Linux system
>>: Page Refactoring Skills - Javascript, CSS
Basic structure: Copy code The code is as follows:...
Table of contents Preface NULL in MySQL 2 NULL oc...
Heart Attributes opacity: .999 creates a stacking...
Preface My needs are syntax highlighting, functio...
The Golden Rule No matter how many people are wor...
Table of contents 1. Introduction 2. Basic Concep...
Preface In backend development, in order to preve...
1. Introduction to Macvlan Before the emergence o...
I found a lot of websites that use drop-down or sl...
Table of contents 1. this keyword 2. Custom attri...
ffmpeg is a very powerful audio and video process...
Table of contents Overview Environment Preparatio...
Table of contents 1. Core commands 2. Common comm...
This article mainly introduces how to evenly dist...
Preface In front-end development, you often need ...