networks:
  proxy:
    external: true


services:

  caddy:
    image: caddy:latest
    container_name: caddy
    hostname: caddy
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
    volumes:
      - ${CONFIG_DIR}/caddy/Caddyfile:/etc/caddy/Caddyfile
      - ${CONFIG_DIR}/caddy/data:/data
      - ${CONFIG_DIR}/caddy/config:/config
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    networks:
      - proxy

  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    hostname: vaultwarden
    restart: unless-stopped
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - DOMAIN=https://vault.jujub.eu
    volumes:
      - ${CONFIG_DIR}/vaultwarden:/data
    networks:
      - proxy

  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    hostname: portainer
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${CONFIG_DIR}/portainer:/data
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    networks:
      - proxy

  dockhand:
    image: fnsys/dockhand:latest
    container_name: dockhand
    hostname: dockhand
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${CONFIG_DIR}/dockhand:/app/data
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    networks:
      - proxy

  filebrowser:
    image: hurlenko/filebrowser:latest
    container_name: filebrowser
    hostname: filebrowser
    restart: unless-stopped
    volumes:
      - /:/data
      - ${CONFIG_DIR}/filebrowser:/config
    user: ${PUID}:${PGID}
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    networks:
      - proxy

  copyparty:
    image: copyparty/ac:latest
    container_name: copyparty
    hostname: copyparty
    user: 1000:1000
    cap_add:
      - DAC_OVERRIDE
      - CHOWN
      - FOWNER
    volumes:
      - ${CONFIG_DIR}/copyparty:/cfg:z
      - /:/w:z
    environment:
      - LD_PRELOAD=/usr/lib/libmimalloc-secure.so.NOPE
      # enable mimalloc by replacing "NOPE" with "2" for a nice speed-boost (will use twice as much ram)
      - PYTHONUNBUFFERED=1
      # ensures log-messages are not delayed (but can reduce speed a tiny bit)
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    networks:
      - proxy

  termix:
    image: ghcr.io/lukegus/termix:latest
    container_name: termix
    hostname: termix
    restart: unless-stopped
    volumes:
      - ${CONFIG_DIR}/termix:/app/data
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    networks:
      - proxy

  homarr:
    image: ghcr.io/homarr-labs/homarr:latest
    container_name: homarr
    hostname: homarr
    restart: unless-stopped
    group_add:
      - 995
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - SECRET_ENCRYPTION_KEY=3565337645346350327136446a4c70304c454564384148615a6d65747a615a56
    volumes:
      - ${CONFIG_DIR}/homarr:/appdata
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - proxy

  homepage:
    image: ghcr.io/gethomepage/homepage:latest
    container_name: homepage
    hostname: homepage
    restart: unless-stopped
    group_add:
      - 995
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - HOMEPAGE_ALLOWED_HOSTS=homepage.jujub.eu
    volumes:
      - ${CONFIG_DIR}/homepage/config:/app/config
      - ${CONFIG_DIR}/homepage/images:/app/public/images
      - ${CONFIG_DIR}/homepage/icons:/app/public/icons
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - proxy  

  dozzle:
    image: amir20/dozzle:latest
    container_name: dozzle
    hostname: dozzle
    restart: unless-stopped
    group_add:
      - 995
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - proxy

  glances:
    image: nicolargo/glances:latest-full
    container_name: glances
    hostname: glances
    restart: unless-stopped
    pid: host
    group_add:
      - 995
    environment:
      GLANCES_OPT: "-w"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - proxy
