version: '2'

services:
  rabbitmq:
    image: rabbitmq
    expose:
      - "5672"

  authentication:
    image: "${ECR_REPOSITORY}/micros/authentication"
    mem_limit: 100
    expose:
      - "3113"

  login:
    image: "${ECR_REPOSITORY}/micros/login"
    mem_limit: 100
    expose:
      - "3116"
    depends_on:
      - authentication
      - user

  mailer:
    image: "${ECR_REPOSITORY}/micros/mailer"
    mem_limit: 100
    environment:
      - C_FORCE_ROOT=1
      - BROKER_URL=amqp://xxx/
      - CONFIG=config/production.ini
    depends_on:
      - rabbitmq
    expose:
      - "3117"

  mailer_worker:
    image: "${ECR_REPOSITORY}/micros/mailer"
    mem_limit: 100
    environment:
      - BROKER_URL=amqp://xxx/
      - CONFIG=config/production.ini
    depends_on:
      - rabbitmq
    command: celery

  pwreset:
    image: "${ECR_REPOSITORY}/micros/pwreset"
    mem_limit: 100
    environment:
      - "SQLA_URL=${DATABASE_URL}"
    expose:
      - "3121"
    depends_on:
      - mailer
      - user

  user:
    image: "${ECR_REPOSITORY}/micros/user"
    mem_limit: 100
    environment:
      - "SQLA_URL=${DATABASE_URL}"
    expose:
      - "3112"

  app:
    image: "${ECR_REPOSITORY}/myrepo/app"
    mem_limit: 256
    ports:
      - "6543:6543"
    depends_on:
      - authentication
      - login
      - mailer
      - mailer_worker
      - pwreset
      - user
    logging:
      driver: awslogs
      options:
        awslogs-group: awslogs-test
        awslogs-region: us-west-2
        awslogs-stream-prefix: app

networks:
  default:
    external:
      name: micros

Add a more complex example
Add a more complex example
