automation/deployer/roles/build/templates/wordpress/docker-compose.yml.j2
2020-05-02 07:51:39 +02:00

45 lines
1.1 KiB
Django/Jinja

version: '3'
# Generated by ansible for site {{ item.url }}
# On network {{ item.subnet_cidr_address }}:
# - web server (nginx) at {{ item.subnet_nginx_ip }}
# - php-fpm (wordpress) at {{ item.subnet_site_ip }}
services:
site:
build: site
restart: always
environment:
WORDPRESS_DB_HOST: "{{ item.subnet_gateway_ip }}"
WORDPRESS_DB_USER: "{{ item.mysql_username }}"
WORDPRESS_DB_PASSWORD: "{{ item.mysql_password }}"
WORDPRESS_DB_NAME: "{{ item.mysql_database }}"
volumes:
- "html_data:/var/www/html"
- "{{ www_path }}/{{ item.slug }}_wp-content:/var/www/html/wp-content"
networks:
net:
ipv4_address: "{{ item.subnet_site_ip }}"
nginx:
build: nginx
restart: always
depends_on:
- site
volumes:
- "html_data:/var/www/html"
- "{{ www_path }}/{{ item.slug }}_wp-content:/var/www/html/wp-content"
networks:
net:
ipv4_address: "{{ item.subnet_nginx_ip }}"
networks:
net:
ipam:
driver: default
config:
- subnet: "{{ item.subnet_cidr_address }}"
volumes:
html_data: