version: "3.3"

services:
  pms-docker:
    image: linuxserver/plex:latest
    networks:
      - traefik
    container_name: plex
    restart: unless-stopped
    hostname: plex.knast.cc
    ports:
      - 32400:32400
      - 3005:3005
      - 8324:8324
      - 32469:32469
      - 1900:1900
      - 32410:32410
      - 32412:32412
      - 32413:32413
      - 32414:32414
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Copenhagen
      - PLEX_CLAIM=claim-kdafJyJP4t8ts3sasfWx
      - ADVERTISE_IP=http://plex.knast.cc:32400/
    volumes:
      - '/srv/plex:/config'
      - "/tmp/:/transcode"
      - "nfs_data:/shares"

    labels:
      - traefik.enable=true
      - "traefik.http.routers.plex.entrypoints=websecure"
      - "traefik.http.routers.plex.rule=Host(`plex.$DOMAIN_NAME`)"
      - "traefik.http.routers.plex.tls=true"
      - "traefik.http.routers.plex.tls.certresolver=letsencr"
      - "traefik.http.services.plex.loadbalancer.server.port=32400"

volumes:
  nfs_data:
    external: true

networks:
  traefik:
    external: true
