version: '2'
services:
  mall4j-mysql:
    build:
      context: ./db
    environment:
      MYSQL_ROOT_PASSWORD: root
    restart: always
    container_name: mall4j-mysql
    ports:
      - 3306:3306
    volumes:
      - ./mall4j-mysql:/var/lib/mysql
    command: --lower_case_table_names=1

  mall4j-redis:
    image: redis:5.0
    restart: always
    container_name: mall4j-redis
    ports:
      - 6379:6379

  mall4j-api:
    build:
      context: ./yami-shop-api
    restart: always
    container_name: mall4j-api
    image: mall4j-api
    ports:
      - 8112:8112
    depends_on:
      - mall4j-redis
      - mall4j-mysql
    links:
      - "mall4j-redis"
      - "mall4j-mysql"

  mall4j-multishop:
    build:
      context: ./yami-shop-multishop
    restart: always
    container_name: mall4j-multishop
    image: mall4j-multishop
    ports:
      - 8113:8113
    depends_on:
      - mall4j-redis
      - mall4j-mysql
    links:
      - "mall4j-redis"
      - "mall4j-mysql"

  mall4j-platform:
    build:
      context: ./yami-shop-platform
    restart: always
    container_name: mall4j-platform
    image: mall4j-platform
    ports:
      - 8114:8114
    depends_on:
      - mall4j-redis
      - mall4j-mysql
    links:
      - "mall4j-redis"
      - "mall4j-mysql"

