version: '3.1'
services:
  web:
    image: etherpad/etherpad
    depends_on:
      - mydb
    ports:
      - "17201:9001"
    environment:
      - ADMIN_PASSWORD=${ETHERPAD_ADMIN_PASSWORD}
      - ADMIN_USER=admin
      - API_KEY=${ETHERPAD_API_KEY}
      - DB_TYPE=postgres
      - DB_HOST=mydb
      - DB_PORT=5432
      - DB_NAME=postgres
      - DB_USER=etherpad
      - DB_PASS=${MARIADB_PASSWORD}
    volumes:
      - './config:/opt/etherpad-lite'
  mydb:
    image: postgres:13
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=${MARIADB_PASSWORD}
      - POSTGRES_USER=etherpad