version: '2'

services:
  postgresdata:
    image: postgres:9.5
    command: /bin/true

  postgres:
    image: postgres:9.5
    restart: always
    env_file:
      - ../postgres.env
    volumes_from:
      - postgresdata

  web:
    image: ghcr.io/huginn/huginn-single-process
    restart: always
    ports:
      - "3000:3000"
    env_file:
      - ../postgres.env
      - ../secrets.env
    depends_on:
      - postgres

  threaded:
    image: ghcr.io/huginn/huginn-single-process
    command: /scripts/init bin/threaded.rb
    restart: always
    env_file:
      - ../postgres.env
      - ../secrets.env
    depends_on:
      - postgres
      - web
