# This needs at least compose 1.6.0
version: '2'

services:
  mysqldata:
    image: mysql:5.7
    command: /bin/true

  mysql:
    image: mysql:5.7
    volumes_from:
      - mysqldata
    environment:
      MYSQL_ROOT_PASSWORD: myrootpassword
      MYSQL_DATABASE: huginn
      MYSQL_USER: huginn
      MYSQL_PASSWORD: myhuginnpassword

  huginn_web:
    image: huginn/huginn-single-process
    restart: always
    extends:
      file: environment.yml
      service: huginn_base
    ports:
      - 3000:3000
    links:
      - mysql
    environment:
      MYSQL_PORT_3306_TCP_ADDR: mysql
      MYSQL_PORT_3306_TCP_PORT: 3306

  huginn_threaded:
    image: huginn/huginn-single-process
    restart: always
    extends:
      file: environment.yml
      service: huginn_base
    links:
      - mysql
    command: /scripts/init bin/threaded.rb
    environment:
      MYSQL_PORT_3306_TCP_ADDR: mysql
      MYSQL_PORT_3306_TCP_PORT: 3306

