Created
September 23, 2016 00:13
-
-
Save valentin2105/9fc96b7491a46ca4d58e090e9c41b7d2 to your computer and use it in GitHub Desktop.
Docker Swarm Wordpress service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker service create --name wordpress-db01 \ | |
--replicas 1 \ | |
-p 3001:3306/tcp \ | |
-e MYSQL_ROOT_PASSWORD=pAssw0rd \ | |
-e MYSQL_DATABASE=wordpress \ | |
--mount type=bind,src=/srv/swarm/wordpress01/db,dst=/var/lib/mysql \ | |
mysql:latest | |
docker service create --name wordpress01 \ | |
--replicas 1 \ | |
-p 8004:80/tcp \ | |
-e WORDPRESS_DB_HOST=<ip>:3001 \ | |
-e WORDPRESS_DB_PASSWORD=pAssw0rd \ | |
-e WORDPRESS_DB_USER=root \ | |
--mount type=bind,src=/srv/swarm/wordpress01/www,dst=/var/www/html \ | |
wordpress:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment