Skip to content

Latest commit

 

History

History

eureka-discovery-service

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

👈 go back

Create eureka discovery service


stack & packages :

java : 17-Maven
spring : 2.7.5
packages : 
    - spring cloud : 2021.0.4
    - spring-cloud-starter-netflix-eureka-server

-> Have a look : 📦 pom.xml


Config :

-> project configuration : application.properties

server.port=8761
eureka.client.fetch-registry=false
eureka.client.register-with-eureka=false

⚙ application.properties


App :

  • This app has one single class, main class, that creates eureka server (annotation) :
@EnableEurekaServer
@SpringBootApplication
public class EurekaDiscoveryServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(EurekaDiscoveryServiceApplication.class, args);
    }
}

Test the app :


Dockerizing the app :

Quick dockerize it with : sh ./Dockerize.sh

FROM openjdk:17.0.2

ENV APP_HOME=/usr/app
WORKDIR $APP_HOME
COPY ./target/*.jar app.jar
EXPOSE 8761
CMD [ "java", "-jar", "app.jar"]

image on DockerHub


< end.