diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e0d9000 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM openjdk:11-jdk +VOLUME /tmp +ARG JAR_FILE=build/libs/farmus-gateway-0.0.1-SNAPSHOT.jar +COPY ${JAR_FILE} farmus-gateway.jar + +ENTRYPOINT ["java","-jar","/farmus-gateway.jar"] \ No newline at end of file diff --git a/build.gradle b/build.gradle index bbea0a8..0773134 100644 --- a/build.gradle +++ b/build.gradle @@ -28,6 +28,7 @@ ext { dependencies { implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation 'org.springframework.cloud:spring-cloud-starter-gateway' + implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' diff --git a/src/main/java/com/example/farmusgateway/FarmusGatewayApplication.java b/src/main/java/com/example/farmusgateway/FarmusGatewayApplication.java index c573d35..f4cb154 100644 --- a/src/main/java/com/example/farmusgateway/FarmusGatewayApplication.java +++ b/src/main/java/com/example/farmusgateway/FarmusGatewayApplication.java @@ -2,8 +2,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @SpringBootApplication +@EnableDiscoveryClient // eureka client public class FarmusGatewayApplication { public static void main(String[] args) {