Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
a1059135e9 | |||
99f155a73d | |||
00bfc3845d | |||
020bed05de | |||
1062d3422a | |||
2fcdcb8586 |
@ -17,7 +17,7 @@ wordpress_debug: ""
|
||||
wordpress_config_extra: ""
|
||||
|
||||
# container
|
||||
wordpress_image: wordpress
|
||||
wordpress_image: eumau/wordpress
|
||||
wordpress_container: wordpress
|
||||
wordpress_volume: wordpress
|
||||
|
||||
|
@ -52,37 +52,21 @@
|
||||
# details)
|
||||
WORDPRESS_CONFIG_EXTRA: "{{ wordpress_config_extra }}"
|
||||
networks:
|
||||
- name: "{{ docker_network_name }}"
|
||||
- name: "{{ docker_network }}"
|
||||
ports:
|
||||
|
||||
- name: template nginx config
|
||||
copy:
|
||||
content: |
|
||||
server {
|
||||
listen 80; # para debug
|
||||
listen 443 ssl;
|
||||
server_name {{ wordpress_domain }};
|
||||
|
||||
# root /var/www/html;
|
||||
# index index.php index.html;
|
||||
# access_log /dev/stdout;
|
||||
# error_log /dev/stdout info;
|
||||
|
||||
location {{ wordpress_web_root }} {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://{{ wordpress_container }};
|
||||
- name: export nginx config
|
||||
set_fact:
|
||||
nginx_config: >-
|
||||
{{ nginx_config | default({}) | combine({
|
||||
wordpress_domain: {
|
||||
"locations": {
|
||||
wordpress_web_root.rstrip('/')+'/': {
|
||||
"proxy_pass": "http://{}:8080".format(wordpress_container)
|
||||
}
|
||||
}
|
||||
dest: "{{ nginx_config_mountpoint }}/wordpress.conf"
|
||||
register: ngconf
|
||||
|
||||
- name: restart frontend
|
||||
docker_container:
|
||||
name: "{{ nginx_container_name }}"
|
||||
restart: yes
|
||||
when: ngconf is changed
|
||||
}
|
||||
}, recursive=True) }}
|
||||
|
||||
- name: inspect wordpress volume
|
||||
docker_volume_info:
|
||||
|
Loading…
x
Reference in New Issue
Block a user