services:
  nextcloud:
    image: linuxserver/nextcloud:latest
    container_name: nextcloud
    networks:
      - nextcloudnet
    environment:
      - PUID=1002   # dockeruser id
      - PGID=100    # dockeruser group
      - TZ=Europe/Berlin
    volumes:
      - /share/Docker/nextcloud/config:/config
      - /share/Docker/nextcloud/data:/data
    ports:
      - 9443:443
    restart: unless-stopped
    depends_on:
      - db

  db:
    image: linuxserver/mariadb:latest
    container_name: nextcloud_db
    networks:
      - nextcloudnet
    environment:
      - PUID=1002
      - PGID=100
      - MYSQL_ROOT_PASSWORD=XXXX # replace with own password
      - TZ=Europe/Berlin
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextclouduser
      - MYSQL_PASSWORD=XXXX # replace with own password
    volumes:
      - /share/Docker/nextcloud/config_db:/config
    restart: unless-stopped

networks:
    nextcloudnet:
        driver: bridge    
        ipam:
          config:
            - subnet: 10.0.8.0/24
              gateway: 10.0.8.1 
