Created
September 17, 2019 12:56
-
-
Save itumulak/c21babc2c5bf31918b0f0c7bd15c76ea to your computer and use it in GitHub Desktop.
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==worker | |
| environment: | |
| WORDPRESS_DB_HOST: db:3306 | |
| WORDPRESS_DB_USER: wordpress | |
| WORDPRESS_DB_PASSWORD: wordpress | |
| labels: | |
| - traefik.docker.network=test_net | |
| - traefik.port=80 | |
| - traefik.frontend.rule=PathPrefix:/; | |
| - traefik.backend.loadbalancer.sticky=true | |
| ports: | |
| - 80 | |
| networks: | |
| - wp | |
| traefik: | |
| image: traefik | |
| command: --docker --docker.swarmode --docker.watch --web --loglevel=DEBUG | |
| ports: | |
| - 80:80 | |
| - 9090:8080 | |
| deploy: | |
| restart_policy: | |
| condition: on-failure | |
| mode: replicated | |
| replicas: 1 | |
| volumes: | |
| - /var/run/docker.sock:/var/run/docker.sock | |
| 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