services:

  cvsite:
    image: r.h-y.st/zeshan:latest
    container_name: zeshan
    restart: always
    networks:
      - hurricane

  vw:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    environment:
      DOMAIN: "https://vault.ztariq.com"
      ADMIN_TOKEN: '$$argon2id$$v=19$$m=65540,t=3,p=4$$iFEc/H/Tg6oBMTNkeToGeA4ThFMOEudDjpgLg0uz53A$$jFTr/G3MH5hwLwfvrEzZGHWYek9TUs57SXGX1YHpdkY'
    volumes:
      - ./data/vaultwarden:/data
    networks:
      - hurricane

  caddy:
    image: caddy:latest
    container_name: caddy
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - ./data/caddy/etc:/etc/caddy 
      - ./data/caddy/data:/data
      - ./data/caddy/config:/config
    networks:
      - hurricane

  plex:
    image: lscr.io/linuxserver/plex:latest
    container_name: plex
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - VERSION=docker
    volumes:
      - ./data/plex:/config
      - /mnt/data/media:/media
    network_mode: host

  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    restart: unless-stopped
    environment:
      - TZ=Europe/London
    volumes:
      - ./data/jellyfin/config:/config
      - ./data/jellyfin/cache:/cache
      - /mnt/data/media:/media
    network_mode: host

  db:
    image: postgres:latest
    container_name: nextcloud-db
    restart: unless-stopped
    environment:
      POSTGRES_DB: nextcloud
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: Shan33779488
    volumes:
      - ./data/postgres:/var/lib/postgresql
    networks:
      - hurricane

  redis:
    image: redis:alpine
    container_name: redis
    restart: unless-stopped
    volumes:
      - ./data/redis:/data
    networks:
      - hurricane

  nextcloud:
    image: nextcloud:latest
    container_name: nextcloud
    restart: unless-stopped
    environment:
      POSTGRES_HOST: db
      POSTGRES_DB: nextcloud
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: Shan33779488
      REDIS_HOST: redis
      TRUSTED_PROXIES: 172.0.0/8,10.0.0/8,192.168.0/16
      OVERWRITEHOST: next.ztariq.com
      OVERWRITEPROTOCOL: https
      OVERWRITECLIURL: https://next.ztariq.com
    volumes:
      - ./data/nextcloud:/var/www/html
    networks:
      - hurricane
    depends_on:
      - db
      - redis

  nextcloud-cron:
    image: nextcloud:latest
    container_name: nextcloud-cron
    restart: unless-stopped
    environment:
      POSTGRES_HOST: db
    volumes:
      - ./data/nextcloud:/var/www/html
    entrypoint: /cron.sh
    networks:
      - hurricane
    depends_on:
      - db
      - redis

networks:
  hurricane:
    external: true
