version: '2'
networks: {}
volumes:
  dockerdev-mysql-volume:
    external: true

services:
  db:
    image: percona
    volumes:
    - ./conf.d/mysql:/etc/mysql/conf.d:ro
    - dockerdev-mysql-volume:/var/lib/mysql:rw
    env_file:
      - ./conf/mysql
    network_mode: bridge
    ports:
      - 127.0.0.1:3306:3306

  mailcatch:
    image: mailhog/mailhog
    network_mode: bridge

  php5:
    build:
      context: php5
    links:
    - blackfire
    - db
    - mailcatch
    - redis
    network_mode: bridge
  php7:
    build:
      context: php7
    links:
    - blackfire
    - db
    - mailcatch
    - redis
    network_mode: bridge

  redis:
    image: redis:alpine
    network_mode: bridge

  web:
    build:
      context: web
    links:
    - mailcatch
    - php5:fpm
    - php5:fpm5
    - php7:fpm7
    network_mode: bridge
    ports:
    - 127.0.0.1:443:443
    - 127.0.0.1:80:80

version: '2'
networks: {}
volumes:
  dockerdev-mysql-volume:
    external: true

services:
  db:
    image: percona
    volumes:
    - ./conf.d/mysql:/etc/mysql/conf.d:ro
    - dockerdev-mysql-volume:/var/lib/mysql:rw
    env_file:
      - ./conf/mysql
    network_mode: bridge
    ports:
      - 127.0.0.1:3306:3306

  mailcatch:
    image: mailhog/mailhog
    network_mode: bridge

  php5:
    build:
      context: php5
    links:
    - blackfire
    - db
    - mailcatch
    - redis
    environment:
      SSH_AUTH_SOCK: "/ssh-socket"
    volumes:
      - ${SSH_AUTH_SOCK}:/ssh-socket:ro
    network_mode: bridge
  php7:
    build:
      context: php7
    links:
    - blackfire
    - db
    - mailcatch
    - redis
    environment:
      SSH_AUTH_SOCK: "/ssh-socket"
    volumes:
      - ${SSH_AUTH_SOCK}:/ssh-socket:ro
    network_mode: bridge

  redis:
    image: redis:alpine
    network_mode: bridge

  web:
    build:
      context: web
    links:
    - mailcatch
    - php5:fpm
    - php5:fpm5
    - php7:fpm7
    network_mode: bridge
    ports:
    - 127.0.0.1:443:443
    - 127.0.0.1:80:80

Use SSH-agent to identify ssh connections
Use SSH-agent to identify ssh connections

* use ssh agent instead of id sharing
  makes it more reliable on bot unix/mac and doesn't
  share the private file with the container
