Skip to content

Instantly share code, notes, and snippets.

@byjg
Last active November 1, 2019 02:59
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 byjg/618e3159b2e7aa2bc2de6b2c9cbf18ab to your computer and use it in GitHub Desktop.
Save byjg/618e3159b2e7aa2bc2de6b2c9cbf18ab to your computer and use it in GitHub Desktop.
Docker Compose Wordpress (Docker Swarm)
version: '3.2'
services:
wordpress:
image: wordpress:4.8-php7.1
environment:
- WORDPRESS_DB_HOST=mysql-container
- WORDPRESS_DB_USER=user
- WORDPRESS_DB_PASSWORD=password
- WORDPRESS_DB_NAME=wordpress
volumes:
- ${PWD}/data/wordpress/wp-content:/var/www/html/wp-content
- ${PWD}/data/wordpress/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
deploy:
replicas: 1
resources:
limits:
cpus: '0.60'
memory: 512M
reservations:
cpus: '0.10'
memory: 64M
restart_policy:
condition: on-failure
networks:
- net
mysql-container:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: password
TZ: UTF
volumes:
- ${PWD}/data/mysql:/var/lib/mysql
- ${PWD}/data/mysql/conf.d:/etc/mysql/conf.d
- ${PWD}/data/mysql/home:/root
deploy:
replicas: 1
resources:
limits:
cpus: '0.80'
memory: 896M
reservations:
cpus: '0.10'
memory: 64M
restart_policy:
condition: on-failure
networks:
- net
networks:
net:
driver: overlay
attachable: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment