services:
  vikunja:
    image: vikunja/vikunja
    environment:
      VIKUNJA_SERVICE_PUBLICURL: http://omv.lan:3456/
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: changeme
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: vikunja
      VIKUNJA_DATABASE_DATABASE: vikunja

      # Email
      VIKUNJA_SERVICE_ENABLEEMAILREMINDERS: 1
      VIKUNJA_DEFAULTSETTINGS_EMAIL_REMINDERS_ENABLED: 1
      VIKUNJA_MAILER_ENABLED: 1
      VIKUNJA_MAILER_HOST: smtp.gmail.com
      VIKUNJA_MAILER_PORT: 587
      VIKUNJA_MAILER_AUTHTYPE: plain
      VIKUNJA_MAILER_USERNAME: bunce.andy@gmail.com
      VIKUNJA_MAILER_PASSWORD: vwnayldwexgyismp
      VIKUNJA_MAILER_SKIPTLSVERIFY: 0
      VIKUNJA_MAILER_FROMEMAIL: admin@vikunja.org
      VIKUNJA_MAILER_QUEUELENGTH: 100
      VIKUNJA_MAILER_QUEUETIMEOUT: 30
      VIKUNJA_MAILER_FORCESSL: 0
    ports:
      - 3456:3456
    volumes:
      - ./files:/app/vikunja/files
    depends_on:
      db:
        condition: service_healthy
    restart: unless-stopped
  db:
    image: mariadb:10
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: supersecret
      MYSQL_USER: vikunja
      MYSQL_PASSWORD: changeme
      MYSQL_DATABASE: vikunja
    volumes:
      - ./db:/var/lib/mysql
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "mysqladmin ping -h localhost -u $$MYSQL_USER --password=$$MYSQL_PASSWORD"]
      interval: 2s
      start_period: 30s