Eureka server does not register services separately

I am running spring boot services using docker-compose.
project link

Eureka server

Two services are registered in one instance instead of each one separated instances.

@SpringBootApplication
@EnableEurekaClient
public class OrganizationApplication {


@Bean
@LoadBalanced
public RestTemplate getRestTemplate(){
    RestTemplate restTemplate = new RestTemplate();
    return restTemplate;

}
public static void main(String[] args) {

    SpringApplication.run(OrganizationApplication.class, args);
  }}

application.yml

eureka:
 instance:
  prefer-ip-address: true
 client:
  register-with-eureka: true
  fetch-registry: true
  service-url:
    default-zone: http://localhost:8761/eureka/

bootstrap.yml

  spring:
application:
 name: OrganizationInstance
profiles:
  active: default
cloud:
 config:
   enabled: true

Source: Docker Questions

LEAVE A COMMENT