
services:
  filebrowser:
    image: filebrowser/filebrowser:s6
    # user: "1000:1000"
    # ports:
    #   - 8188:8188
    healthcheck:
      test: curl -f http://localhost:8188/ || exit 1
    restart: unless-stopped
    # user: "1000:113"
    # healthcheck:
    #   test: ["CMD", "curl", "-f", "http://localhost:8188/health"]
    #   interval: 30s
    #   timeout: 20s
    #   retries: 3
    security_opt:
      - no-new-privileges:true
    volumes:
      - nfs_data:/data
      - /srv/file_browser/config/settings.json:/config/settings.json:ro
      - /srv/file_browser/database/:/database/
    networks:
      - traefik
    environment:
      - PUID=${MYUID}
      - PGID=${MYGID}
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.files.entrypoints=websecure"
      - "traefik.http.routers.files.rule=Host(`files.knast.cc`)"
      - "traefik.http.routers.files.tls.certresolver=letsencr"
      # - traefik.http.middlewares.https_redirect.redirectscheme.scheme=https
      # - traefik.http.routers.http_catchall.middlewares=https_redirect
      - "traefik.http.services.files.loadbalancer.server.port=8188"
      # - "traefik.http.routers.files.middlewares=files_auth"
      # - "traefik.http.middlewares.files_auth.basicauth.users=admin:$$2a$$12$$MkhjqyuriyoE5.Mhz14ZXOkfjE7wUEDb46e9argix38VHZ5aAuGQC"        
#    restart: always

# services:
#   filebrowser:
#     ports:
#       - "8228:80"
#     volumes:
#       - "nfs_data:/srv"
#       - "/srv/file_browser/database.db:/database.db:rw"
#       - "/srv/file_browser/.filebrowser.json:/.filebrowser.json:ro"
#       # - type: bind
#       #   source: /srv/file_browser/.filebrowser.json
#       #   target: /.filebrowser.json
#     networks:
#       - traefik
#     labels:
#       - "traefik.enable=true"
#       - "traefik.http.routers.files.entrypoints=websecure"
#       - "traefik.http.routers.files.rule=Host(`files.$DOMAIN_NAME`)"
#       - "traefik.http.routers.files.tls.certresolver=letsencr"
#       # - traefik.http.middlewares.https_redirect.redirectscheme.scheme=https
#       # - traefik.http.routers.http_catchall.middlewares=https_redirect
#       - "traefik.http.services.files.loadbalancer.server.port=80"
#       - "traefik.http.routers.files.middlewares=files_auth"
#       - "traefik.http.middlewares.files_auth.basicauth.users=admin:$$2a$$12$$MkhjqyuriyoE5.Mhz14ZXOkfjE7wUEDb46e9argix38VHZ5aAuGQC"
#     restart: unless-stopped
#     image: filebrowser/filebrowser
    
volumes:
  nfs_data:
    external: true


networks:
  traefik:
    external: true


