version: "2"
services:
  php:
    container_name: open_loyalty_backend
    build:
      context: '../'
      dockerfile: './docker/dev/php/fpm-dockerfile'
    links:
      - db
      - elk
      - mail
    ports:
      - "9000:9000"
    volumes:
      - backend-sync:/var/www/openloyalty:nocopy
      - ./backend/docker/xdebug.ini:/usr/local/etc/php.d/xdebug.ini
    env_file:
        - .env
  nginx:
    container_name: open_loyalty_frontend
    build:
      context: '../'
      dockerfile: './docker/dev/web/backend-dockerfile'
    links:
      - php
    ports:
      - "80:80"
  elk:
    container_name: open_loyalty_elk
    build:
      context: '../'
      dockerfile: './docker/base/elasticsearch-dockerfile'
    ports:
      - "9999:9200"
  db:
    container_name: open_loyalty_db
    image: postgres:9
    ports:
      - "5432:5432"
    env_file:
        - .env
  mail:
    container_name: open_loyalty_mail
    image: mailhog/mailhog
    ports:
      - "8186:8025"
volumes:
  backend-sync:
    external: true
