init commit

This commit is contained in:
2025-07-28 23:52:33 -04:00
parent e59ad8ad7f
commit eff0d2fee2
27 changed files with 1041 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
---
- name: "Create file structure"
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ data_dir }}/caddy"
- "{{ data_dir }}/caddy/data"
- "{{ data_dir }}/caddy/certs"
- name: Create Caddyfile
template:
src: Caddyfile.j2
dest: "{{ data_dir }}/caddy/Caddyfile"
- name: Create Dockerfile
template:
src: Dockerfile.j2
dest: "{{ data_dir }}/caddy/Dockerfile"
- name: Build Caddy Image
docker_image:
name: caddy
tag: "latest"
build:
path: "{{ data_dir }}/caddy"
dockerfile: "Dockerfile"
source: build
state: present
- name: Deploy Caddy Container
docker_container:
name: caddy
image: caddy:latest
recreate: true
restart_policy: unless-stopped
networks:
- name: homelab
env:
CLOUDFLARE_TOKEN: "{{ CADDY_CLOUDFLARE_TOKEN }}"
HOST_IP: "{{ CADDY_HOST_IP }}"
VIDEO_MACHINE: "{{ CADDY_VIDEO_MACHINE }}"
volumes:
- "{{ data_dir }}/caddy/data:/data"
- "{{ data_dir }}/caddy/certs:/etc/letsencrypt"
- "{{ data_dir }}/caddy/Caddyfile:/etc/caddy/Caddyfile"
published_ports:
- 80:80
- 443:443