# 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
