From c8f22f83e2bd08057f9d33056e5bed5a3013fc4d Mon Sep 17 00:00:00 2001 From: Phil Date: Sat, 4 Jan 2025 09:09:47 -0700 Subject: [PATCH] add ghost to stack for phlog --- roles/docker/files/Caddyfile | 4 ++++ roles/docker/tasks/ghost-1.yml | 19 ++++++++++++++++ roles/docker/tasks/main.yml | 6 ++++- roles/docker/templates/ghost-1-compose.yml.j2 | 22 +++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 roles/docker/tasks/ghost-1.yml create mode 100644 roles/docker/templates/ghost-1-compose.yml.j2 diff --git a/roles/docker/files/Caddyfile b/roles/docker/files/Caddyfile index 936e176..61cdd7d 100644 --- a/roles/docker/files/Caddyfile +++ b/roles/docker/files/Caddyfile @@ -32,6 +32,10 @@ tasks.thesatelliteoflove.com { reverse_proxy authentik-server-1:9000 } +phlog.thesatelliteoflove.com { + reverse_proxy ghost-1-ghost-1:2368 +} + code.thesatelliteoflove.com { reverse_proxy authentik-server-1:9000 } diff --git a/roles/docker/tasks/ghost-1.yml b/roles/docker/tasks/ghost-1.yml new file mode 100644 index 0000000..bd95b13 --- /dev/null +++ b/roles/docker/tasks/ghost-1.yml @@ -0,0 +1,19 @@ +- name: make ghost-1 directories + ansible.builtin.file: + path: "{{ item}}" + state: directory + loop: + - /opt/stacks/ghost-1 + +- name: Template out the compose file + ansible.builtin.template: + src: ghost-1-compose.yml.j2 + dest: /opt/stacks/ghost-1/compose.yml + owner: root + mode: 644 + +- name: deploy ghost-1 stack + community.docker.docker_compose_v2: + project_src: /opt/stacks/ghost-1 + files: + - compose.yml \ No newline at end of file diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 3da6870..8824aa6 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -136,4 +136,8 @@ - name: Install syncthing import_tasks: syncthing.yml - tags: syncthing \ No newline at end of file + tags: syncthing + +- name: Install ghost-1 + import_tasks: ghost-1.yml + tags: ghost-1 diff --git a/roles/docker/templates/ghost-1-compose.yml.j2 b/roles/docker/templates/ghost-1-compose.yml.j2 new file mode 100644 index 0000000..d9b644a --- /dev/null +++ b/roles/docker/templates/ghost-1-compose.yml.j2 @@ -0,0 +1,22 @@ +services: + + ghost: + image: ghost:5-alpine + restart: unless-stopped + environment: + - database__client=sqlite3 + - database__connection__filename=/var/lib/ghost/content/data/ghost.db + - database__useNullAsDefault=true + - url=https://phlog.thesatelliteoflove.com + volumes: + - ghost:/var/lib/ghost/content + extra_hosts: + - 'phlog.thesatelliteoflove.com:172.20.0.5' + +volumes: + ghost: + driver: local +networks: + default: + external: true + name: lava \ No newline at end of file