services:
  complex:
    image: smartclean-complex:${VERSION:-latest}
    container_name: smartclean-complex
    build:
      context: ../..
      dockerfile: deploy/docker-app/Dockerfile.complex
    ports:
      - "${COMPLEX_PORT:-18091}:8080"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - complex_logs:/app/logs
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://localhost:8080/"]
      interval: 15s
      timeout: 5s
      retries: 5
      start_period: 90s
    restart: on-failure:3
    networks:
      - smartclean-app

  mall:
    image: smartclean-mall:${VERSION:-latest}
    container_name: smartclean-mall
    build:
      context: ../..
      dockerfile: deploy/docker-app/Dockerfile.mall
    ports:
      - "${MALL_PORT:-18086}:8080"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - mall_logs:/app/logs
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://localhost:8080/"]
      interval: 15s
      timeout: 5s
      retries: 5
      start_period: 90s
    restart: on-failure:3
    networks:
      - smartclean-app

volumes:
  complex_logs:
  mall_logs:

networks:
  smartclean-app:
    driver: bridge
