version: "3"
services:
#  redis:
#    image: redis:alpine
#    restart: always
#    networks:
#      - backend
  config:
    build:
      context: ./config-server
      args:
        JAR_FILE: target/config-server-1.0-SNAPSHOT.jar
    expose:
      - "1001"
    restart: always
    networks:
      - backend
  eureka:
    build: 
      context: ./eureka-server
      args:
        JAR_FILE: target/eureka-server-1.0-SNAPSHOT.jar
    expose:
      - "1101"
    depends_on:
      - config
    restart: always
    networks:
      - backend
  gateway:
    build: 
      context: ./gateway
      args:
        JAR_FILE: target/gateway-1.0-SNAPSHOT.jar
    ports:
      - "8080:8080"
    depends_on:
      - config
      - eureka
    restart: always
    networks:
      - frontend
      - backend
  user:
    build: 
      context: ./service-user
      args:
        JAR_FILE: target/service-user-1.0-SNAPSHOT.jar
    expose:
      - "2202"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  org:
    build: 
      context: ./service-org
      args:
        JAR_FILE: target/service-org-1.0-SNAPSHOT.jar
    expose:
      - "2203"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  advertisement:
    build: 
      context: ./service-advertisement
      args:
        JAR_FILE: target/service-advertisement-1.0-SNAPSHOT.jar
    expose:
      - "2001"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  device:
    build: 
      context: ./service-device
      args:
        JAR_FILE: target/service-device-1.0-SNAPSHOT.jar
    expose:
      - "2003"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  member:
    build: 
      context: ./service-member
      args:
        JAR_FILE: target/service-member-1.0-SNAPSHOT.jar
    expose:
      - "2010"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  inventory:
    build: 
      context: ./service-inventory
      args:
        JAR_FILE: target/service-inventory-1.0-SNAPSHOT.jar
    expose:
      - "2208"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  ota:
    build: 
      context: ./service-ota
      args:
        JAR_FILE: target/service-ota-1.0-SNAPSHOT.jar
    expose:
      - "2002"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  payment:
    build: 
      context: ./service-payment
      args:
        JAR_FILE: target/service-payment-1.0-SNAPSHOT.jar
    expose:
      - "80"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  ssl:
    build: 
      context: ./service-ssl
      args:
        JAR_FILE: target/service-ssl-1.0-SNAPSHOT.jar
    expose:
      - "2004"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  trade:
    build: 
      context: ./service-trade
      args:
        JAR_FILE: target/service-trade-1.0-SNAPSHOT.jar
    expose:
      - "2008"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  wxopen:
    build: 
      context: ./service-wxopen
      args:
        JAR_FILE: target/service-wxopen-1.0-SNAPSHOT.jar
    expose:
      - "2201"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend
  promotion:
    build:
      context: ./service-promotion
      args:
        JAR_FILE: target/service-promotion-1.0-SNAPSHOT.jar
    expose:
      - "2023"
    depends_on:
      - config
      - eureka
#      - redis
    restart: always
    networks:
      - backend

networks:
  frontend:
  backend:
