version: '2'
services:
  db:
    image: postgres
    environment:
      - POSTGRES_USER=saleor
      - POSTGRES_PASSWORD=saleor
    ports:
      - '127.0.0.1:5432:5432'
  redis:
    image: redis
    ports:
      - '127.0.0.1:6379:6379'
  search:
    image: elasticsearch:5.4.3
    mem_limit: 1g
    environment:
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ports:
      - '127.0.0.1:9200:9200'
  web:
    build: .
    command: python manage.py runserver 0.0.0.0:8000
    environment:
      - DATABASE_URL=postgres://saleor:saleor@db/saleor
      - DEFAULT_FROM_EMAIL=noreply@example.com
      - ELASTICSEARCH_URL=http://search:9200
      - OPENEXCHANGERATES_API_KEY
      - REDIS_URL=redis://redis:6379/0
      - SECRET_KEY=changeme
    depends_on:
      - db
      - redis
      - search
    ports:
      - '8000:8000'
    volumes:
      - .:/app:Z

version: '2'
services:
  db:
    image: postgres
    environment:
      - POSTGRES_USER=saleor
      - POSTGRES_PASSWORD=saleor
    ports:
      - '127.0.0.1:5432:5432'
  redis:
    image: redis
    ports:
      - '127.0.0.1:6379:6379'
  search:
    image: elasticsearch:5.4.3
    mem_limit: 512m
    environment:
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ports:
      - '127.0.0.1:9200:9200'
  web:
    build: .
    command: python manage.py runserver 0.0.0.0:8000
    environment:
      - DATABASE_URL=postgres://saleor:saleor@db/saleor
      - DEFAULT_FROM_EMAIL=noreply@example.com
      - ELASTICSEARCH_URL=http://search:9200
      - OPENEXCHANGERATES_API_KEY
      - REDIS_URL=redis://redis:6379/0
      - SECRET_KEY=changeme
    depends_on:
      - db
      - redis
      - search
    ports:
      - '8000:8000'
    volumes:
      - .:/app:Z

Align memory limits of container and elasticsearch
Align memory limits of container and elasticsearch
