version: "3"
services:
  nextcloud:
    image: linuxserver/nextcloud
    container_name: nextcloud
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Stockholm
    volumes:
      - </path/to/appdata>:/config
      - <path/to/data>:/data
    ports:
      - 7999:443
    restart: unless-stopped
    volumes:
      - ${DIR}/nextcloud/data:/data
      - ${DIR}/nextcloud/config:/config
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.nextcloud-service.loadbalancer.server.port=3000"
      - "traefik.http.routers.nextcloud-secure.entrypoints=web-secure"
      - "traefik.http.routers.nextcloud-secure.rule=Host(`nextcloud.${DOMAIN}`)"
      - "traefik.http.routers.nextcloud-secure.tls.certresolver=milvert"

networks:
  frontend:
    external: true
  backend:
    external: false

