2020-05-02 22:21:33 +00:00
|
|
|
---
|
|
|
|
version: "3.7"
|
|
|
|
|
|
|
|
services:
|
|
|
|
wordpress:
|
2020-05-15 18:26:04 +00:00
|
|
|
image: "wordpress:5.4.1"
|
2020-05-02 22:21:33 +00:00
|
|
|
ports:
|
2020-05-15 21:22:26 +00:00
|
|
|
- "3050:80"
|
2020-05-02 22:21:33 +00:00
|
|
|
volumes:
|
2020-05-02 22:44:28 +00:00
|
|
|
- "wp:/var/www/html"
|
2020-05-02 22:21:33 +00:00
|
|
|
networks:
|
2020-05-02 23:07:50 +00:00
|
|
|
- backend
|
2020-05-02 22:21:33 +00:00
|
|
|
- proxy
|
|
|
|
environment:
|
|
|
|
- WORDPRESS_DB_HOST=mariadb
|
2020-05-02 22:45:51 +00:00
|
|
|
- WORDPRESS_DB_USER=wordpress
|
2020-05-02 22:44:28 +00:00
|
|
|
- WORDPRESS_DB_PASSWORD_FILE=/run/secrets/wp-db-passwd-v1
|
2020-05-02 22:45:51 +00:00
|
|
|
- WORDPRESS_DB_NAME=wordpress
|
2020-05-02 22:31:31 +00:00
|
|
|
secrets:
|
2020-05-02 22:44:28 +00:00
|
|
|
- wp-db-passwd-v1
|
2020-05-02 22:21:33 +00:00
|
|
|
deploy:
|
|
|
|
mode: replicated
|
|
|
|
replicas: 1
|
|
|
|
update_config:
|
|
|
|
failure_action: rollback
|
|
|
|
placement:
|
|
|
|
constraints:
|
|
|
|
- node.role == manager
|
|
|
|
labels:
|
2020-05-15 18:26:04 +00:00
|
|
|
traefik.enable: "true"
|
|
|
|
traefik.http.services.wordpress.loadbalancer.server.port: "80"
|
2020-05-15 21:22:26 +00:00
|
|
|
traefik.http.routers.wordpress.rule: "Host(`wp.swarm.autonomic.zone`)"
|
2020-05-15 18:26:04 +00:00
|
|
|
traefik.http.routers.wordpress.entrypoints: "web-secure"
|
|
|
|
traefik.http.routers.wordpress.tls.certresolver: "staging"
|
2020-05-02 22:21:33 +00:00
|
|
|
|
|
|
|
mariadb:
|
2020-05-15 18:26:04 +00:00
|
|
|
image: "mariadb:10.5"
|
2020-05-02 22:21:33 +00:00
|
|
|
volumes:
|
2020-05-02 22:44:28 +00:00
|
|
|
- "db:/var/lib/mysql"
|
2020-05-02 23:07:50 +00:00
|
|
|
networks:
|
|
|
|
- backend
|
2020-05-02 22:21:33 +00:00
|
|
|
environment:
|
2020-05-02 22:44:28 +00:00
|
|
|
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql-root-passwd-v1
|
2020-05-02 22:21:33 +00:00
|
|
|
- MYSQL_DATABASE=wordpress
|
|
|
|
- MYSQL_USER=wordpress
|
2020-05-02 22:44:28 +00:00
|
|
|
- MYSQL_PASSWORD_FILE=/run/secrets/mysql-user-passwd-v1
|
2020-05-02 22:31:31 +00:00
|
|
|
secrets:
|
2020-05-02 22:44:28 +00:00
|
|
|
- mysql-root-passwd-v1
|
|
|
|
- mysql-user-passwd-v1
|
2020-05-02 22:21:33 +00:00
|
|
|
|
|
|
|
networks:
|
2020-05-02 23:07:50 +00:00
|
|
|
backend:
|
2020-05-02 23:22:19 +00:00
|
|
|
driver: overlay
|
2020-05-02 22:21:33 +00:00
|
|
|
proxy:
|
|
|
|
external: true
|
|
|
|
|
|
|
|
volumes:
|
2020-05-02 22:44:28 +00:00
|
|
|
db:
|
|
|
|
wp:
|
2020-05-02 22:21:33 +00:00
|
|
|
|
|
|
|
secrets:
|
2020-05-02 22:44:28 +00:00
|
|
|
wp-db-passwd-v1:
|
2020-05-02 22:31:31 +00:00
|
|
|
external: true
|
2020-05-02 22:44:28 +00:00
|
|
|
mysql-root-passwd-v1:
|
2020-05-02 22:31:31 +00:00
|
|
|
external: true
|
2020-05-02 22:44:28 +00:00
|
|
|
mysql-user-passwd-v1:
|
2020-05-02 22:31:31 +00:00
|
|
|
external: true
|