services:
  redis:
    image: redis:alpine
    container_name: redis
    hostname: redis
    restart: unless-stopped
    environment:
      TZ: Europe/Moscow

  nextcloud:
    image: nextcloud:${NC_VER}
    container_name: nextcloud
    hostname: nextcloud
    restart: unless-stopped
    ports:
      - 8081:80
    dns:
      - 8.8.8.8
    extra_hosts:
      - ${NC_DOMAIN}:host-gateway
    depends_on:
      - redis
    volumes:
      - /opt/configs/nextcloud/app:/var/www/html
      - /opt/data/nextcloud:/var/www/html/data
      - /mnt/yandex:/mnt/yandex:shared
    environment:
      TZ: Europe/Moscow
      VIRTUAL_HOST: ${NC_DOMAIN}
      NEXTCLOUD_TRUSTED_DOMAINS: ${NC_DOMAIN} 127.0.0.1
      NEXTCLOUD_OVERWRITEPROTOCOL: https
      NEXTCLOUD_OVERWRITEHOST: ${NC_DOMAIN}
      NEXTCLOUD_OVERWRITECLIURL: https://${NC_DOMAIN}
      REDIS_HOST: redis
      TRUSTED_PROXIES: ${TRUSTED_PROXIES}

  cron:
    image: nextcloud:${NC_VER}
    hostname: cron
    container_name: cron
    restart: unless-stopped
    volumes:
      - /opt/configs/nextcloud/app:/var/www/html
      - /opt/data/nextcloud:/var/www/html/data
    entrypoint: /cron.sh
    depends_on:
      - nextcloud
    environment:
      TZ: Europe/Moscow
      REDIS_HOST: redis

networks: {}
