version: '2'

volumes:
  postgres_data_dev: {}
  postgres_backup_dev: {}

services:
  postgres:
    build: ./compose/postgres
    volumes:
      - postgres_data_dev:/var/lib/postgresql/data
      - postgres_backup_dev:/backups
    environment:
      - POSTGRES_USER=mhackspace

  django:
    build:
      context: .
      dockerfile: ./compose/django/Dockerfile-dev
    command: /start-dev.sh
    depends_on:
      - postgres
    environment:
      - POSTGRES_USER=mhackspace
      - USE_DOCKER=yes
    volumes:
      - .:/app
    ports:
      - "8180:8000"
    links:
      - postgres
      - mailhog

  mailhog:
    image: mailhog/mailhog
    ports:
      - "8125:8025"

  node:
    image: node:7-onbuild
    command: npm install
    volumes:
      - ./:/usr/src/app
  # redis:
  #   image: redis:latest
