2018-06-24 13:17:35 +00:00
|
|
|
---
|
|
|
|
|
2019-02-13 09:36:04 +00:00
|
|
|
- name: create nginx-proxy volume folders
|
|
|
|
file:
|
2022-11-25 12:55:50 +00:00
|
|
|
name: "{{ services.nginx_proxy.volume_folder }}/{{ volume }}"
|
2019-02-13 09:36:04 +00:00
|
|
|
state: directory
|
|
|
|
loop:
|
2019-01-26 16:54:45 +00:00
|
|
|
- conf
|
|
|
|
- vhost
|
|
|
|
- html
|
|
|
|
- dhparam
|
|
|
|
- certs
|
|
|
|
loop_control:
|
|
|
|
loop_var: volume
|
2019-01-19 13:56:23 +00:00
|
|
|
|
2019-01-26 16:54:45 +00:00
|
|
|
- name: nginx proxy container
|
|
|
|
docker_container:
|
|
|
|
name: nginx-proxy
|
2022-11-25 12:55:50 +00:00
|
|
|
image: nginxproxy/nginx-proxy:{{ services.nginx_proxy.version }}
|
2019-01-26 16:54:45 +00:00
|
|
|
restart_policy: always
|
2019-01-19 13:56:23 +00:00
|
|
|
networks:
|
2019-01-26 16:54:45 +00:00
|
|
|
- name: external_services
|
|
|
|
published_ports:
|
2018-06-24 13:17:35 +00:00
|
|
|
- "80:80"
|
2019-01-19 13:56:23 +00:00
|
|
|
- "443:443"
|
2018-06-24 13:17:35 +00:00
|
|
|
volumes:
|
2022-11-25 12:55:50 +00:00
|
|
|
- "{{ services.nginx_proxy.volume_folder }}/conf:/etc/nginx/conf.d"
|
|
|
|
- "{{ services.nginx_proxy.volume_folder }}/vhost:/etc/nginx/vhost.d"
|
|
|
|
- "{{ services.nginx_proxy.volume_folder }}/html:/usr/share/nginx/html"
|
|
|
|
- "{{ services.nginx_proxy.volume_folder }}/dhparam:/etc/nginx/dhparam"
|
|
|
|
- "{{ services.nginx_proxy.volume_folder }}/certs:/etc/nginx/certs:ro"
|
2018-06-24 13:17:35 +00:00
|
|
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
2019-01-19 13:56:23 +00:00
|
|
|
|
2019-01-26 16:54:45 +00:00
|
|
|
- name: nginx letsencrypt container
|
|
|
|
docker_container:
|
|
|
|
name: nginx-proxy-le
|
2022-11-25 12:55:50 +00:00
|
|
|
image: nginxproxy/acme-companion:{{ services.nginx_acme_companion.version }}
|
2019-01-26 16:54:45 +00:00
|
|
|
restart_policy: always
|
2019-01-19 13:56:23 +00:00
|
|
|
volumes:
|
2022-11-25 12:55:50 +00:00
|
|
|
- "{{ services.nginx_proxy.volume_folder }}/vhost:/etc/nginx/vhost.d"
|
|
|
|
- "{{ services.nginx_proxy.volume_folder }}/html:/usr/share/nginx/html"
|
|
|
|
- "{{ services.nginx_proxy.volume_folder }}/dhparam:/etc/nginx/dhparam:ro"
|
|
|
|
- "{{ services.nginx_proxy.volume_folder }}/certs:/etc/nginx/certs"
|
2019-01-19 13:56:23 +00:00
|
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
2019-01-26 16:54:45 +00:00
|
|
|
env:
|
|
|
|
NGINX_PROXY_CONTAINER: nginx-proxy
|
2022-11-25 13:07:09 +00:00
|
|
|
when: letsencrypt_enabled
|
2019-02-13 09:36:04 +00:00
|
|
|
|