Last active
September 17, 2019 12:30
-
-
Save itumulak/8d126ad8d1ba63c3a5340ee10c6b9e06 to your computer and use it in GitHub Desktop.
Docker WordPress Stack
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
| version: '3.7' | |
| services: | |
| db: | |
| image: mysql:5.7 | |
| volumes: | |
| - db_data:/var/lib/mysql | |
| deploy: | |
| restart_policy: | |
| condition: on-failure | |
| placement: | |
| constraints: | |
| - node.role==manager | |
| environment: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: wordpress | |
| MYSQL_USER: wordpress | |
| MYSQL_PASSWORD: wordpress | |
| networks: | |
| - wp | |
| wordpress: | |
| image: wordpress:5.2.3-php7.1-fpm | |
| volumes: | |
| - ./wordpress:/var/www/html | |
| deploy: | |
| restart_policy: | |
| condition: on-failure | |
| placement: | |
| constraints: | |
| - node.role==manager | |
| environment: | |
| WORDPRESS_DB_HOST: db:3306 | |
| WORDPRESS_DB_USER: wordpress | |
| WORDPRESS_DB_PASSWORD: wordpress | |
| networks: | |
| - wp | |
| nginx: | |
| image: nginx:latest | |
| ports: | |
| - 80:80 | |
| deploy: | |
| restart_policy: | |
| condition: on-failure | |
| mode: replicated | |
| replicas: 4 | |
| volumes: | |
| - type: bind | |
| source: ./default.conf | |
| target: /etc/nginx/conf.d/default.conf | |
| - ./wordpress:/var/www/html | |
| networks: | |
| - wp | |
| networks: | |
| wp: | |
| driver: overlay | |
| volumes: | |
| db_data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment