Docker Compose builds and deploys LNMP actual combat (with deployment script)

1. Introduction to docker-compose

docker-compose is used for multi-container control of docker. With docker-compose, we can automate all complex docker operations with one command.

In plain language, we usually operate docker is still a very primitive series of actions, you can split the actions of using docker manually.

Search mirrors:

docker search

Run the mirror:

docker run -d -it 你的镜像

This is the smallest action, if you want to map the hard disk, set up nat network or bridge network, etc... you have to do more docker operations, which is obviously very inefficient.

But it's fine if we write it in docker-compose.yml.

Just need to run a sentence after writing:

docker-compose up -d

Everything is so simple.

2. Use of docker-compose

Compose supports three major platforms: Linux, macOS, and Windows 10. Compose can be installed through the Python package management tool pip, or you can directly download and use the compiled binary files, and even run directly in the Docker container. It is recommended to use the binary package method to install, just download the compiled binary file directly from the official: https://github.com/docker/compose/releases .

For example, directly download the corresponding binary package on a Linux 64-bit system.

 

Guess you like

Origin blog.csdn.net/qq_35029061/article/details/132201059