version: '3'

volumes:
  bundle:
  m2:
  node_modules:
  build:

services:
  postgres:
    image: postgres
    container_name: asciinema_dev_postgres

  redis:
    image: redis
    container_name: asciinema_dev_redis

  smtp:
    image: namshi/smtp
    container_name: asciinema_dev_smtp

  web:
    build: .
    image: asciinema/asciinema.org
    container_name: asciinema_dev_web
    command: /bin/bash
    links:
      - redis
      - postgres
      - smtp
    env_file: .env.development
    ports:
      - 3000:3000
      - 4000:4000
      - 4040:4040
    volumes:
      - ../uploads:/app/uploads:cached
      - ../deps:/app/deps:cached
      - bundle:/bundle:cached
      - node_modules:/app/node_modules:cached
      - build:/app/_build:cached
      - m2:/root/.m2:cached
      - ../:/app:cached
      - /tmp/asciinema-web:/tmp
