Skip to content

Instantly share code, notes, and snippets.

@valentin2105
Created September 23, 2016 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valentin2105/9fc96b7491a46ca4d58e090e9c41b7d2 to your computer and use it in GitHub Desktop.
Save valentin2105/9fc96b7491a46ca4d58e090e9c41b7d2 to your computer and use it in GitHub Desktop.
Docker Swarm Wordpress service
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