wordpress: Add wordpress service template

This commit is contained in:
Kacper Donat 2023-02-12 16:02:03 +01:00
parent 07468c2efa
commit 43b3caa31e
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,24 @@
version: "{{ compose_version }}"
services:
wordpress:
image: wordpress
networks: ["{{ ingress_network }}", "default"]
environment:
WORDPRESS_DB_HOST: "{{ database_mysql_host }}"
WORDPRESS_DB_USER: "{{ wordpress_db_user }}"
WORDPRESS_DB_PASSWORD: "{{ wordpress_db_pass }}"
WORDPRESS_DB_NAME: "{{ wordpress_db_name }}"
volumes:
- wordpress_data:/var/www/html
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.{{ service }}.rule={{ traefik_routing_rule }}
- traefik.http.routers.{{ service }}.tls=true
- traefik.http.routers.{{ service }}.tls.certresolver=lets-encrypt
- traefik.http.routers.{{ service }}.middlewares=gzip@file
- traefik.http.services.{{ service }}.loadbalancer.server.port=80
volumes:
wordpress_data: ~

View File

@ -0,0 +1,2 @@
---
wordpress_db_pass: "{{ mysql_user_passwords[wordpress_db_user] }}"