version: "3.7"

services:
  freshrss:
    image: lscr.io/linuxserver/freshrss:1.23.1
    container_name: freshrss
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=${TZ}
    volumes:
      - ${APP_DATA_DIR}/data/freshrss:/config
    ports:
      - ${APP_PORT}:80
    restart: unless-stopped
    networks:
      - tipi_main_network
    labels:
      # Main
      traefik.enable: true
      traefik.http.middlewares.freshrss-web-redirect.redirectscheme.scheme: https
      traefik.http.services.freshrss.loadbalancer.server.port: 80
      # Web
      traefik.http.routers.freshrss-insecure.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.freshrss-insecure.entrypoints: web
      traefik.http.routers.freshrss-insecure.service: freshrss
      traefik.http.routers.freshrss-insecure.middlewares: freshrss-web-redirect
      # Websecure
      traefik.http.routers.freshrss.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.freshrss.entrypoints: websecure
      traefik.http.routers.freshrss.service: freshrss
      traefik.http.routers.freshrss.tls.certresolver: myresolver
      # Local domain
      traefik.http.routers.freshrss-local-insecure.rule: Host(`freshrss.${LOCAL_DOMAIN}`)
      traefik.http.routers.freshrss-local-insecure.entrypoints: web
      traefik.http.routers.freshrss-local-insecure.service: freshrss
      traefik.http.routers.freshrss-local-insecure.middlewares: freshrss-web-redirect
      # Local domain secure
      traefik.http.routers.freshrss-local.rule: Host(`freshrss.${LOCAL_DOMAIN}`)
      traefik.http.routers.freshrss-local.entrypoints: websecure
      traefik.http.routers.freshrss-local.service: freshrss
      traefik.http.routers.freshrss-local.tls: true
