version: '3.7'
name: spt-magento

services:
  mariadb:
    image: mariadb:10.4
    container_name: mariadb
    ports:
      - "3306:3306"
    environment:
      # think about .env file here
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - ./../.mariadb:/var/lib/mysql
    restart: always
    networks:
      - default
  php-apache:
    build:
      context: .
      dockerfile: Dockerfile
    image: 'php_apache'
    container_name: php-apache
    environment:
      - "APACHE_LOG_DIR:/src"
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - ./apache:/etc/apache2/sites-available/ssl
      - ./../src:/var/www/html
    networks:
      - default
    depends_on:
      - mariadb
      - elasticsearch
  elasticsearch:
    image: docker.io/bitnami/elasticsearch:7
    volumes:
      - ./../.elasticsearch:/bitnami/elasticsearch/data'
  phpmyadmin:
    image: phpmyadmin
    container_name: phpmyadmin
    restart: always
    ports:
      - "81:80"
    environment:
      - PMA_ARBITRARY=1
    networks:
      - default
networks:
  default: