version: '2'

services:
  httpd:
    build: ./docker/httpd/
    hostname: webserver
    ports:
      - 80:80
    links:
      - php7
    volumes_from:
      - app
    depends_on:
      - sql

  php7:
    build: ./docker/php/php7/
    hostname: php
    expose:
      - 9000
    links:
      - sql
    volumes_from:
      - app
    depends_on:
      - sql

  app:
    image: php:7.2-fpm
    # this     ^^^ is also in Dockerfile, not enough to change here.
    volumes:
...
      - ./docker/httpd/etc/httpd.conf:/usr/local/apache2/conf/httpd.conf
      - ./docker/php/php.ini:/usr/local/etc/php/php.ini
    command: "true"

  sql:
    image: mariadb:10.1
    hostname: db
    volumes_from:
      - data
      - app
    environment:
      MYSQL_ROOT_PASSWORD: innensevedd

  data:
    image: mariadb:10.1
    volumes:
    - ./mariadb/varlib:/var/lib/mysql
    - ./mariadb/files:/var/lib/mysql-files
    - ./mariadb/etc:/etc/mysql
    command: "true"
