version: "2"
services:
  codewind-pfe:
    image: ${REPOSITORY}codewind-pfe${PLATFORM}:${TAG}
    container_name: codewind-pfe
    # Run as root (not mcuser) in local docker so portal can access the docker socket
    user: root
    environment:
      - HOST_WORKSPACE_DIRECTORY=${WORKSPACE_DIRECTORY}
      - CONTAINER_WORKSPACE_DIRECTORY=/codewind-workspace
      - HOST_OS=${HOST_OS}
      - CODEWIND_VERSION=${TAG}
      - PERFORMANCE_CONTAINER=codewind-performance${PLATFORM}:${TAG}
      - REMOTE_MODE=${REMOTE_MODE}
      - HOST_HOME=${HOST_HOME}
      - HOST_MAVEN_OPTS=${HOST_MAVEN_OPTS}
    depends_on:
      - codewind-performance
    ports:
      - "127.0.0.1:34000-35000:9090"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${WORKSPACE_VOLUME}:/codewind-workspace
    networks:
      - network

  codewind-performance:
    build: ./src/performance/.
    image: codewind-performance${PLATFORM}:${TAG}
    ports:
      - "127.0.0.1:9095:9095"
    container_name: codewind-performance
    networks:
      - network

networks:
  network:
