It has been serving three menu Sites from an untracked directory, so today's state was not reproducible or revertible.
31 lines
771 B
YAML
31 lines
771 B
YAML
---
|
|
# Tasks for Nginx role to serve static files
|
|
- name: Pull Nginx image
|
|
docker_image:
|
|
name: "{{ image_name }}"
|
|
source: pull
|
|
force_source: yes
|
|
|
|
- name: Ensure Host Directory exist
|
|
file:
|
|
path: "{{ host_directory }}"
|
|
state: directory
|
|
mode: 0755
|
|
|
|
# - name: Upload the Nginx config file
|
|
# template:
|
|
# src: "files/nginx.conf.j2"
|
|
# dest: "{{ host_directory }}/nginx.conf"
|
|
|
|
- name: Create caddy container
|
|
docker_container:
|
|
name: "{{ docker_container }}"
|
|
image: "{{ image_name }}"
|
|
state: started
|
|
restart_policy: unless-stopped
|
|
volumes:
|
|
# - "{{ host_directory }}/nginx.conf:/etc/nginx/nginx.conf:ro"
|
|
- "{{ host_directory }}:/usr/share/nginx/html:ro"
|
|
networks:
|
|
- name: "{{ docker_network }}"
|