![]() You now have a WordPress container and MySQL container running on your host. Just as when running a single container with docker run, the -d flag starts the containers in detached mode. This will build and run the db and wordpress containers. Save the file and run Docker Compose from the same directory: docker-compose up -d Version : '3' services : db : image : mysql:5.7 volumes : - db_data:/var/lib/mysql restart : always environment : MYSQL_ROOT_PASSWORD : somewordpress MYSQL_DATABASE : wordpress MYSQL_USER : wordpress MYSQL_PASSWORD : wordpress wordpress : depends_on : - db image : wordpress:latest ports : - "8000:80" restart : always environment : WORDPRESS_DB_HOST : db:3306 WORDPRESS_DB_USER : wordpress WORDPRESS_DB_PASSWORD : wordpress volumes : db_data: Open docker-compose.yml in a text editor and add the following content: This section will review an example Docker Compose file taken from the Set file permissions: sudo chmod +x /usr/local/bin/docker-compose ![]() Releases page and replace 1.25.4 in the command below with the version tagged as Latest release: sudo curl -L `uname -s`-`uname -m` -o /usr/local/bin/docker-compose Install Docker Composeĭownload the latest version of Docker Compose. Install Docker Engine section of Docker’s official documentation. Installing and Using Docker on CentOS and Fedoraįor complete instructions on even more Linux distributions, reference the Installing and Using Docker on Ubuntu and Debian To install Docker CE (Community Edition), follow the instructions within one of the guides below: You will need a Linode with Docker CE installed to follow along with the steps in this guide. Managing containers running on different hosts usually requires an additional tool, such as Generally the containers in an application built using Docker Compose will all run on the same host.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |