version: "2"

services:
  php:
    container_name: openloyalty_backend
    build:
      context: '../'
      dockerfile: './docker/prod/php/fpm-dockerfile'
    links:
      - db
      - elk
      - mail
    depends_on:
      - db
    env_file:
        - .env
  nginx:
    container_name: openloyalty_frontend
    build:
      context: '../'
      dockerfile: './docker/prod/web/app-dockerfile'
    links:
      - php
    ports:
      - "80:80"
      - "8182:3001"
      - "8183:3002"
      - "8184:3003"
  elk:
    container_name: openloyalty_elk
    build:
      context: '../'
      dockerfile: './docker/base/elasticsearch-dockerfile'
  db:
    container_name: openloyalty_db
    image: postgres:9
    env_file:
        - .env
  mail:
    container_name: openloyalty_mail
    image: mailhog/mailhog
    ports:
      - "8186:8025"
