update
This commit is contained in:
7
roles/ind/healthcheck/docker-compose.env
Normal file
7
roles/ind/healthcheck/docker-compose.env
Normal file
@@ -0,0 +1,7 @@
|
||||
ALLOWED_HOSTS=healthcheck.local
|
||||
DEFAULT_FROM_EMAIL=healthcheck@homelab.com
|
||||
EMAIL_HOST=stmp@healthcheck.local
|
||||
EMAIL_HOST_PASSWORD=password
|
||||
EMAIL_HOST_USER=user
|
||||
SECRET_KEY=jnweqcrun2409vn8q9p34nf2iunskjdncv
|
||||
SITE_ROOT=http://192.168.0.60
|
||||
@@ -6,31 +6,29 @@
|
||||
|
||||
vars:
|
||||
docker_compose_definition: |
|
||||
volumes:
|
||||
db-data:
|
||||
|
||||
services:
|
||||
cronicle:
|
||||
image: ghcr.io/soulteary/cronicle:latest
|
||||
container_name: cronicle
|
||||
hostname: cronicle
|
||||
environment:
|
||||
- TZ=America/Chicago
|
||||
db:
|
||||
image: postgres:16
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- ./data/data:/opt/cronicle/data
|
||||
- ./data/logs:/opt/cronicle/logs
|
||||
- ./data/plugins:/opt/cronicle/plugins
|
||||
- db-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_DB=$DB_NAME
|
||||
- POSTGRES_PASSWORD=$DB_PASSWORD
|
||||
web:
|
||||
image: healthchecks/healthchecks:latest
|
||||
env_file:
|
||||
- docker-compose.env
|
||||
ports:
|
||||
- 3012:3012
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:3012/api/app/ping || exit 1"]
|
||||
interval: 5s
|
||||
timeout: 1s
|
||||
retries: 3
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
- "8000:8000"
|
||||
# To enable SMTP on port 2525, set SMTPD_PORT=2525 in .env
|
||||
# and uncomment the following line:
|
||||
# - "2525:2525"
|
||||
depends_on:
|
||||
- db
|
||||
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; uwsgi /opt/healthchecks/docker/uwsgi.ini'
|
||||
|
||||
|
||||
tasks:
|
||||
@@ -48,14 +46,14 @@
|
||||
|
||||
- name: Setup Service
|
||||
copy:
|
||||
dest: /etc/systemd/system/cronicle.service
|
||||
dest: /etc/systemd/system/healthcheck.service
|
||||
content: |
|
||||
[Unit]
|
||||
Description=cronicle
|
||||
Description=healthcheck
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=cronicle
|
||||
User=healthcheck
|
||||
WorkingDirectory=/home/docker/
|
||||
ExecStart=docker compose up -d
|
||||
Restart=always
|
||||
@@ -75,25 +73,25 @@
|
||||
group: docker
|
||||
mode: u=rw,g=r,o=r
|
||||
|
||||
- name: Check if cronicle's data directory exists
|
||||
- name: Check if healthcheck's data directory exists
|
||||
stat:
|
||||
path: /data/data
|
||||
register: cronicle_stat
|
||||
register: healthcheck_stat
|
||||
|
||||
- name: Restore cronicle Dir
|
||||
- name: Restore healthcheck Dir
|
||||
shell: |
|
||||
restic --password-file /home/restic/.resticpassword -r sftp:misamisa://home/restic/$(hostname) --target / restore latest
|
||||
args:
|
||||
chdir: /home/restic
|
||||
creates: /data/cronicle
|
||||
when: not cronicle_stat.stat.exists or not cronicle_stat.stat.isdir
|
||||
creates: /data/healthcheck
|
||||
when: not healthcheck_stat.stat.exists or not healthcheck_stat.stat.isdir
|
||||
|
||||
- name: Reload systemd daemon
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
|
||||
- name: Start cronicle Service
|
||||
- name: Start healthcheck Service
|
||||
systemd:
|
||||
name: cronicle
|
||||
name: healthcheck
|
||||
state: started
|
||||
enabled: yes
|
||||
Reference in New Issue
Block a user