services:
  db:
    image: mariadb:10.11
    container_name: nextcloud-db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: zdsm#mariadb#99
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_PASSWORD: zdsm#mariadb#99
    volumes:
      - ./nextcloud-db:/var/lib/mysql
  redis:
    image: redis:alpine
    container_name: nextcloud-redis
    restart: unless-stopped
    volumes:
      - ./nextcloud/nextcloud-redis:/data

  app:
    image: nextcloud:latest
    container_name: nextcloud-app
    restart: unless-stopped
    ports:
      - "2284:80"
    environment:
      MYSQL_HOST: db
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_PASSWORD: zdsm#mariadb#99
      REDIS_HOST: redis
      NEXTCLOUD_ADMIN_USER: zdsm99
      NEXTCLOUD_ADMIN_PASSWORD: zdsm#nextcloud#99
      PHP_MEMORY_LIMIT: 1G
    volumes:
      - ./nextcloud:/var/www/html
      - ./data:/var/www/html/data
    depends_on:
      - db
      - redis
