# this will load a multi-container running Moodle, connected to a Mariadb, and with a Jobe sandbox service

services:
  mariadb:
    image: docker.io/bitnami/mariadb:latest
    container_name: mariadb
    restart: always
    environment:
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_USER=bn_moodle
      - MARIADB_DATABASE=bitnami_moodle
      - MARIADB_CHARACTER_SET=utf8mb4
      - MARIADB_COLLATE=utf8mb4_unicode_ci
    networks:
      - moodle-network
  jobe:
    image: trampgeek/jobeinabox:latest
    container_name: jobe
    restart: always
    environment:
      - JOBE_SERVER_ALLOWED_HOSTS=*
    # ports:
    #   - '5000:80'
    networks:
      - moodle-network
  moodle:
    image: docker.io/bitnami/moodle:latest
    container_name: moodle
    restart: always
    depends_on:
      - mariadb
      - jobe
    environment:
      - MOODLE_DATABASE_HOST=mariadb
      - MOODLE_DATABASE_PORT_NUMBER=3306
      - MOODLE_DATABASE_USER=bn_moodle
      - MOODLE_DATABASE_NAME=bitnami_moodle
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
    ports:
      - '80:8080'
      - '443:8443'
    networks:
      - moodle-network

networks:
  moodle-network:
      external: false
