version: '3.7'

services:

  mag_sql:
    image: mariadb
    container_name: "magrathea-sql"
    command: --default-authentication-plugin=mysql_native_password
    volumes:
      - ./databases/mysql:/application
      - ./backups:/home/backups
    env_file:
      - ./.env
    ports:
      - 3306

  magrathea_php:
    hostname: contacts.magrathea.localhost.com
    container_name: "magrathea-php"
    build:
      context: .
      dockerfile: ./Dockerfile-php
    volumes: 
      - /home/paulo/Rincewind/Magrathea/MagratheaPHP/Magrathea:/var/www/magrathea
#      - ./_magrathea:/var/www/magrathea
      - ../configs:/var/www/configs
      - ../api:/var/www/api
      - ../app:/var/www/app
      - ../logs:/var/www/logs
      - ../vendor:/var/www/vendor
    ports:
      - 8080:8080
      - 80:80
      - 443
    env_file:
      - ./.env

# helper containers:
  magrathea1_phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: magrathea-dev_pma
    environment:
      PMA_HOST: mag_sql
      PMA_PORT: 3306
      PMA_ARBITRARY: 1
    depends_on:
      - mag_sql
    ports:
      - 8183:80






