services:
  mariadb:
    image: mariadb:10.11
    container_name: flarum-db
    environment:
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
      MYSQL_DATABASE: flarum
      MYSQL_USER: flarum
      MYSQL_PASSWORD: ${DB_PASSWORD}
    volumes:
      - flarum-db:/var/lib/mysql
    restart: unless-stopped

  flarum:
    image: ghcr.io/mondediefr/flarum:latest
    container_name: flarum
    depends_on:
      - mariadb
    ports:
      - "7000:8888"
    environment:
      FORUM_URL: https://pdmn.bookfightclub.org
      DB_HOST: mariadb
      DB_NAME: flarum
      DB_USER: flarum
      DB_PASS: ${DB_PASSWORD}
      FLARUM_ADMIN_USER: admin
      FLARUM_ADMIN_PASS: ${ADMIN_PASSWORD}
      FLARUM_ADMIN_MAIL: ${ADMIN_EMAIL}
      FLARUM_TITLE: "BFC Community Forum"
    volumes:
      - flarum-assets:/flarum/app/public/assets
      - flarum-extensions:/flarum/app/extensions
    restart: unless-stopped

volumes:
  flarum-db:
  flarum-assets:
  flarum-extensions:
