version: '2'
services:
  db:
    image: mariadb
    container_name: nextcloud-iutsd-db
    restart: always
    command: ['--innodb_read_only_compressed=OFF']
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=*$6E@md$C977
      - MYSQL_PASSWORD=p@$$w0rd
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud:latest
    container_name: nextcloud-iutsd
    restart: always
    user: 1000:1000
    sysctls:
      - net.ipv4.ip_unprivileged_port_start=0
    volumes:
      - /mnt/data/iutsd/data:/var/www/html/data
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Paris
      - VIRTUAL_HOST=cloud-iutsd.micard-family.fr
      - LETSENCRYPT_HOST=cloud-iutsd.micard-family.fr
      - LETSENCRYPT_EMAIL=emilien.micard@gmail.com
      - MYSQL_HOST=nextcloud-iutsd-db
      - MYSQL_PASSWORD=p@$$w0rd
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    depends_on:
      - db


networks:
    default:
        external:
            name: proxy_nginxproxy
