From 9df844173ecf3e68e0f598e73a089a8f1bc36861 Mon Sep 17 00:00:00 2001 From: Davide Polonio Date: Sun, 12 Jan 2025 23:22:22 +0100 Subject: [PATCH] feat: first deployment of FireflyIII --- firefly/Caddyfile | 5 ++ firefly/docker-compose.yaml | 97 +++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 firefly/Caddyfile create mode 100644 firefly/docker-compose.yaml diff --git a/firefly/Caddyfile b/firefly/Caddyfile new file mode 100644 index 0000000..d1e6b1f --- /dev/null +++ b/firefly/Caddyfile @@ -0,0 +1,5 @@ +https://money.lan.poldebra.me { + tls /cert.crt /key.key + reverse_proxy app:8080 { + } +} \ No newline at end of file diff --git a/firefly/docker-compose.yaml b/firefly/docker-compose.yaml new file mode 100644 index 0000000..d737ad0 --- /dev/null +++ b/firefly/docker-compose.yaml @@ -0,0 +1,97 @@ +services: + mock: + image: nginx:alpine + restart: unless-stopped + env_file: + - .env + networks: + - proxy + + reverse_proxy: + image: caddy:alpine + restart: unless-stopped + network_mode: service:tailscale + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile:ro + - /srv/docker/reverse_proxy/certs/money.lan.poldebra.me/fullchain.pem:/cert.crt:ro + - /srv/docker/reverse_proxy/certs/money.lan.poldebra.me/key.pem:/key.key:ro + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "https://diary.lan.poldebra.me"] + interval: 5s + timeout: 10s + retries: 3 + depends_on: + app: + condition: service_started + tailscale: + condition: service_healthy + + tailscale: + hostname: money + image: tailscale/tailscale:latest + restart: unless-stopped + healthcheck: + test: ["CMD-SHELL", "tailscale status"] + interval: 1s + timeout: 5s + retries: 60 + volumes: + - tailscale:/var/lib + - /lib/modules:/lib/modules:ro + devices: + - /dev/net/tun:/dev/net/tun + cap_add: + - net_admin + - sys_module + - net_raw + command: tailscaled + + app: + image: fireflyiii/core:latest + hostname: app + container_name: firefly_iii_core + restart: unless-stopped + volumes: + - upload:/var/www/html/storage/upload + - db:/var/www/html/storage/database + env_file: .firefly.env + + cron: + # + # To make this work, set STATIC_CRON_TOKEN in your .env file or as an environment variable and replace REPLACEME below + # The STATIC_CRON_TOKEN must be *exactly* 32 characters long + # + image: alpine + restart: unless-stopped + container_name: firefly_iii_cron + env_file: .firefly.env + command: sh -c " + apk add tzdata + && ln -s /usr/share/zoneinfo/${TZ} /etc/localtime + | echo \"0 3 * * * wget -qO- http://app:8080/api/v1/cron/${STATIC_CRON_TOKEN};echo\" + | crontab - + && crond -f -L /dev/stdout" + +volumes: + upload: + driver: local + driver_opts: + type: none + o: bind + device: "/srv/docker/firefly/upload" + db: + driver: local + driver_opts: + type: none + o: bind + device: "/srv/docker/firefly/db" + tailscale: + driver: local + driver_opts: + type: none + o: bind + device: "/srv/docker/firefly/tailscale" + +networks: + proxy: + external: true -- 2.40.1