miniflux: add docker compose config
This commit is contained in:
parent
86f741c3e9
commit
b1d70248f1
7 changed files with 122 additions and 14 deletions
|
|
@ -1,3 +1,3 @@
|
|||
nws.roosens.me {
|
||||
reverse_proxy {{ groups['miniflux'][0] }}:8080
|
||||
reverse_proxy {{ hostvars[groups['miniflux'][0]].static_ip }}:8002
|
||||
}
|
||||
|
|
|
|||
5
roles/miniflux/files/miniflux.backup.sh
Normal file
5
roles/miniflux/files/miniflux.backup.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
cd /etc/miniflux
|
||||
|
||||
/usr/bin/docker compose exec -T db pg_dump -U miniflux miniflux |
|
||||
/usr/bin/gzip --rsyncable |
|
||||
/usr/local/bin/restic backup --stdin --stdin-filename miniflux-postgres.sql.gz
|
||||
43
roles/miniflux/tasks/main.yml
Normal file
43
roles/miniflux/tasks/main.yml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
- name: Ensure data directory is present
|
||||
ansible.builtin.file:
|
||||
path: '/mnt/data1/miniflux'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
|
||||
- name: Ensure data subvolumes are present
|
||||
community.general.btrfs_subvolume:
|
||||
name: '/miniflux/{{ item }}'
|
||||
with_items:
|
||||
- 'postgres'
|
||||
|
||||
- name: Ensure configuration directory is present
|
||||
file:
|
||||
path: '/etc/miniflux'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Ensure compose file is present
|
||||
template:
|
||||
src: 'compose.yml.j2'
|
||||
dest: '/etc/miniflux/compose.yml'
|
||||
mode: '0644'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
register: res
|
||||
|
||||
- name: Ensure stack is deployed
|
||||
ansible.builtin.shell:
|
||||
chdir: '/etc/miniflux'
|
||||
cmd: 'docker compose up -d --remove-orphans'
|
||||
when: 'res.changed'
|
||||
|
||||
- name: Ensure backup script is present
|
||||
ansible.builtin.copy:
|
||||
src: 'miniflux.backup.sh'
|
||||
dest: '/etc/backups/miniflux.backup.sh'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0644'
|
||||
46
roles/miniflux/templates/compose.yml.j2
Normal file
46
roles/miniflux/templates/compose.yml.j2
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# vim: ft=yaml
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
app:
|
||||
image: 'miniflux/miniflux:2.0.51'
|
||||
restart: 'always'
|
||||
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
environment:
|
||||
- DATABASE_URL=postgres://miniflux:miniflux@db/miniflux?sslmode=disable
|
||||
- RUN_MIGRATIONS=1
|
||||
- CREATE_ADMIN=1
|
||||
- ADMIN_USERNAME={{ miniflux_admin }}
|
||||
- ADMIN_PASSWORD={{ miniflux_admin_pass }}
|
||||
|
||||
# Don't stress the system too much
|
||||
- WORKER_POOL_SIZE=1
|
||||
- BASE_URL=https://nws.roosens.me
|
||||
|
||||
# Default scheduling settings should be good
|
||||
|
||||
# I'm a hoarder
|
||||
- CLEANUP_ARCHIVE_UNREAD_DAYS=-1
|
||||
- CLEANUP_ARCHIVE_READ_DAYS=-1
|
||||
ports:
|
||||
- "8002:8080"
|
||||
|
||||
db:
|
||||
image: 'postgres:16.1-alpine'
|
||||
restart: 'always'
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready", "-U", "miniflux"]
|
||||
interval: 10s
|
||||
start_period: 30s
|
||||
|
||||
environment:
|
||||
- POSTGRES_USER=miniflux
|
||||
- POSTGRES_PASSWORD=miniflux
|
||||
- POSTGRES_DB=miniflux
|
||||
volumes:
|
||||
- /mnt/data1/miniflux/postgres:/var/lib/postgresql/data
|
||||
Loading…
Add table
Add a link
Reference in a new issue