Docker Container is a technology that aims to package your API and all its dependencies, an example is the architecture that is used below. 5 containers and each carrying service in a totally isolated environment among them.
Operation of Docker Container on WordPress
Mounting an architecture infrastructure with containers has many advantages; among them we can name the security issue between the processes, lack of internal network problems and the use of limited resources that even makes it easy to analyze problems.
Example: Docker command stats for containers
The official repository of Docker Hub has hundreds of APIs as memcache, redis, mongo, node, MySQL, HTTPD.
WordPress has its official docker container: With it, you can easily have installation containerized.
Example:
docker run --detach \ --name nestify-container \ --link some-container-com-mysql:mysql \ -e WORDPRESS_DB_HOST=171.21.0.1:4306 \ -e WORDPRESS_DB_USER=root \ -e WORDPRESS_DB_PASSWORD=root \ -e WORDPRESS_DB_NAME=Nestify_WordPress \ -p 8080:80 \ wordpress
After running the installation command, it will be active and can be accessed with https: // localhost: 8080 or https: // host-IP: 8080 in your browser.
To copy your site into the container you can use the command:
docker cp /path/host/archive nestify-container:/path/archive/inside/container
We use the containers in our daily lives, do not hesitate to contact us for more information .
Sources:
- https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-docker-on-ubuntu/
- https://docs.docker.com/engine/understanding-docker/
- https://docs.docker.com/engine/tutorials/dockerizing/
- https://docs.docker.com/compose/wordpress/