version: '3'
services:
  app:
    user: "0:0"
    image: etherpad/etherpad:latest
    tty: true
    stdin_open: true
    volumes:
      - plugins:/opt/etherpad-lite/src/plugin_packages
      - etherpad-var:/opt/etherpad-lite/var
    depends_on:
      - mysql
    environment:
      NODE_ENV: production
      ADMIN_PASSWORD: ${DOCKER_COMPOSE_APP_ADMIN_PASSWORD:-admin}
      DB_CHARSET: ${DOCKER_COMPOSE_APP_DB_CHARSET:-utf8mb4}
      DB_HOST: mysql
      DB_NAME: ${DOCKER_COMPOSE_MYSQL_DATABASE:-Adess-etherpad}
      DB_PASS: ${DOCKER_COMPOSE_MYSQL_PASSWORD:-root}
      DB_PORT: ${DOCKER_COMPOSE_MYSQL_PORT:-3306}
      DB_TYPE: "mysql"
      DB_USER: root
      DEFAULT_PAD_TEXT: ${DOCKER_COMPOSE_APP_DEFAULT_PAD_TEXT:- }
      DISABLE_IP_LOGGING: ${DOCKER_COMPOSE_APP_DISABLE_IP_LOGGING:-false}
      SOFFICE: ${DOCKER_COMPOSE_APP_SOFFICE:-null}
      TRUST_PROXY: ${DOCKER_COMPOSE_APP_TRUST_PROXY:-true}
    restart: always
    ports:
      - "${DOCKER_COMPOSE_APP_PORT_PUBLISHED:-9001}:${DOCKER_COMPOSE_APP_PORT_TARGET:-9001}"

  mysql:
    image: mysql:8.0
    environment:
      MYSQL_DATABASE: ${DOCKER_COMPOSE_MYSQL_DATABASE:-Adess-etherpad}
      MYSQL_ROOT_PASSWORD: ${DOCKER_COMPOSE_MYSQL_PASSWORD:-root}
    restart: always
    volumes:
      - mysql_data:/var/lib/mysql

volumes:
  mysql_data:
  plugins:
  etherpad-var: