version: "2"
services:
  <%= name %>-rabbitmq:
    image: rabbitmq

  <%= name %>-db:
    build:
      context: .
      dockerfile: Dockerfile.db
    env_file: .env.db

  <%= name %>-common: &common
    build:
      context: .
      args:
        - SKYCRAWLERS_ENV=development
    links:
      - <%= name %>-rabbitmq
      - <%= name %>-db
    volumes:
      - ./:/home/crawler
      - ./docker-cache/.bundle:/home/crawler/.bundle
      - ./docker-cache/bundle:/home/crawler/vendor/bundle
    working_dir: /home/crawler
    env_file: .env

  <%= name %>-crawler:
    <<: *common
    command: crawler

  <%= name %>-processor:
    <<: *common
    depends_on:
      - <%= name %>-crawler
    command: processor

version: "2"
services:
  <%= name %>-rabbitmq:
    image: rabbitmq
    volumes:
      - <%= name %>-rabbitmq-storage:/var/lib/rabbitmq

  <%= name %>-db:
    build:
      context: .
      dockerfile: Dockerfile.db
    volumes:
      - <%= name %>-db-storage:/var/lib/postgresql/data
    env_file: .env.db

  <%= name %>-common: &common
    build:
      context: .
      args:
        - SKYCRAWLERS_ENV=development
    links:
      - <%= name %>-rabbitmq
      - <%= name %>-db
    volumes:
      - ./:/home/crawler
      - ./docker-cache/.bundle:/home/crawler/.bundle
      - ./docker-cache/bundle:/home/crawler/vendor/bundle
    working_dir: /home/crawler
    env_file: .env

  <%= name %>-crawler:
    <<: *common
    command: crawler

  <%= name %>-processor:
    <<: *common
    depends_on:
      - <%= name %>-crawler
    command: processor

volumes:
  <%= name %>-db-storage:
  <%= name %>-rabbitmq-storage:

Use named volume to create volume for each app
Use named volume to create volume for each app

Create 2 crawler applications:

```
$ daimon_skycrawlers new crawler1
$ daimon_skycrawlers new crawler2
```

In previous version, crawler1 and crawler2 use shared volume (for
PostgreSQL and rabbitmq-server)

In this version, crawler1 uses crawler1-db-storage and
crawler1-rabbitmq-storage, crawler2 uses crawler2-db-storage and
crawler2-rabbitmq-storage.

They will use separated named volumes.
