version: "3"
services:
  flaskfetfotos:
    image: flask-fet-fotos
    environment:
     FLASK_DEBUG: 1
     FLASK_APP: main.py
     pages_root: /app/data
    volumes:
      - /mnt/fotos/www:/app/data
  mysql:
    image: mariadb
    environment:
      MYSQL_DATABASE: fet2020db
      MYSQL_USER: user
      MYSQL_PASSWORD: hgu
      MYSQL_COLLATION: utf8_general_ci
      MYSQL_CHARSET: utf8
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
    volumes:
     - ../mysql_django:/var/lib/mysql
  etherpadsql:
    image: mariadb
    environment:
      MYSQL_DATABASE: etherpaddb
      MYSQL_USER: user
      MYSQL_PASSWORD: hgu
      MYSQL_COLLATION: utf8_general_ci
      MYSQL_CHARSET: utf8
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
    volumes:
     - ../mysql_etherpad:/var/lib/mysql
  etherpad:
    image: etherpad/etherpad
    environment:
      DB_TYPE: mysql
      DB_HOST: etherpadsql
      DB_PORT: 3306
      DB_NAME: etherpaddb
      DB_USER: root
      DB_PASS: ""
      DB_CHARSET: utf8
      #ADMIN_PASSWORD: "AndiS"
      #REQUIRE_AUTHENTICATION: "false"
      TRUST_PROXY: "true"
      REQUIRE_SESSION: "true"
      #LOGLEVEL: "DEBUG"     
    depends_on:
      - etherpadsql
    ports:
     - "9001:9001"
    volumes:
     - ./etherpad/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt
     - ./deployment/mysql.cnf:/etc/mysql/conf.d
  fet2020:
    image: fet2020django
    build: .
    environment:
     - HOST_NAME
     - DEBUG
     - SECRET_KEY
     - MYSQL_USER
     - MYSQL_PASSWORD
     - MYSQL_PORT
    depends_on:
    - mysql
    ports:
      - "8001:8080" 
    volumes:
      - ./fet2020:/app
      - ./assets:/app/assets
      - ./etherpad:/app/etherpad
volumes:
  ep-mysql-volume:
  mysql-volume:
