mirror of
https://github.com/davestephens/ansible-nas
synced 2024-12-27 03:53:06 +00:00
ce21999f46
NOTE: The majority of traefik ports were totally broken and would never have worked. It should be the external port there, not the internal container port!. Port conflicts were fixed.
38 lines
No EOL
1.1 KiB
YAML
38 lines
No EOL
1.1 KiB
YAML
---
|
|
- name: Create Nginx Directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- "{{ nginx_data_directory }}"
|
|
- "{{ nginx_data_directory }}/certs"
|
|
- "{{ nginx_data_directory }}/html"
|
|
- "{{ nginx_data_directory }}/vhost.d"
|
|
|
|
- name: Nginx Docker Container
|
|
docker_container:
|
|
name: nginx-proxy
|
|
image: jwilder/nginx-proxy
|
|
pull: true
|
|
ports:
|
|
- "{{ nginx_port_http }}:80"
|
|
- "{{ nginx_port_https }}:443"
|
|
volumes:
|
|
- "{{ nginx_data_directory }}/certs:/etc/nginx/certs:ro"
|
|
- "{{ nginx_data_directory }}/vhost.d:/etc/nginx/vhost.d:rw"
|
|
- "{{ nginx_data_directory }}/html:/usr/share/nginx/html:rw"
|
|
- "/var/run/docker.sock:/tmp/docker.sock:ro"
|
|
restart_policy: unless-stopped
|
|
memory: 1g
|
|
|
|
- name: Nginx Letsencrypt Container
|
|
docker_container:
|
|
name: letsencrypt-nginx-proxy-companion
|
|
image: jrcs/letsencrypt-nginx-proxy-companion
|
|
pull: true
|
|
volumes:
|
|
- "{{ nginx_data_directory }}/certs:/etc/nginx/certs:rw"
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
volumes_from: nginx-proxy
|
|
restart_policy: unless-stopped
|
|
memory: 1g |