version: '3.8'

services:
  db:
    image: mariadb:11
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=18654Peter!
      - MYSQL_PASSWORD=18654Peter!
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  redis:
    image: redis:alpine
    restart: always
    volumes:
      - redis:/data

  app:
    image: nextcloud:latest
    restart: always
    ports:
      - 9999:80
    links:
      - db
      - redis
    volumes:
      - /drive1/nextcloud:/var/www/html
      - /drive2:/mnt/drive2:rw
      - /:/mnt/root:rw
    environment:
      - MYSQL_PASSWORD=18654Peter!
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
      - REDIS_HOST=redis
      - NEXTCLOUD_ADMIN_USER=AcreetionAdmin
      - NEXTCLOUD_ADMIN_PASSWORD=18654Peter!
    depends_on:
      - db
      - redis

volumes:
  db:
  redis:
