version: '2'

services:
  nextcloud:
    image: nextcloud
    restart: always
    container_name: nextcloud
    hostname: nextcloud
    environment:
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=n3xtcl0ud.
      - MYSQL_HOST=mariadb-nextcloud
    depends_on:
      - mariadb-nextcloud
    expose:
      - 80
    links:
      - mariadb-nextcloud
    volumes:
      - ./nextcloud/html/custom_apps:/var/www/html/custom_apps
      - ./nextcloud/html/config:/var/www/html/config
      - ./nextcloud/html/data:/var/www/html/data
      - ./nextcloud/html/themes:/var/www/html/themes
    networks:
      mynet:
        ipv4_address: 172.119.0.101

  mariadb-nextcloud:
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    container_name: mariadb-nextcloud
    hostname: mariadb-nextcloud
    volumes:
      - ./nextcloud/mysql:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=n3xtcl0ud.
      - MYSQL_PASSWORD=n3xtcl0ud.
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    networks:
      mynet:
        ipv4_address: 172.119.0.102

networks:
  mynet:
    driver: bridge
    ipam:
      config:
      - subnet: 172.119.0.0/24

