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