services:
  php:
    build:
      dockerfile: ./docker/php/dockerfile
    volumes:
      - './src/:/var/www/html'
      - './docker/php/php.ini:/usr/local/etc/php/conf.d/php.ini'

  nginx:
    image: nginx:latest
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - './src:/var/www/html'
      - './docker/nginx:/etc/nginx/conf.d'
    depends_on:
      - php

  mariadb:
    image: mariadb:10.6
    restart: 'on-failure'
    environment:
      MARIADB_DATABASE: db
      MARIADB_ROOT_PASSWORD: root
    volumes:
      - ./db.sql.gz:/docker-entrypoint-initdb.d/db.sql.gz
      - db:/var/lib/mysql

  elasticsearch:
    image: elasticsearch:7.4.0
    restart: 'on-failure'
    environment:
      - discovery.type=single-node

volumes:
    db:
