Config Server and Eureka updates (#34)
* update config and eureka versions, enable discovery-first config, make eureka settings more conducive to local development
This commit is contained in:
Родитель
e48ddae5ab
Коммит
244e17137f
|
@ -7,13 +7,13 @@ WORKDIR /scratch
|
|||
RUN apk add httpie && apk add patch
|
||||
RUN http https://start.spring.io/starter.zip \
|
||||
type==gradle-project \
|
||||
platformVersion==3.2.2 \
|
||||
platformVersion==3.2.4 \
|
||||
jvmVersion==21 \
|
||||
groupId==io.steeltoe.docker \
|
||||
artifactId==configserver \
|
||||
applicationName==ConfigServer \
|
||||
language==java \
|
||||
dependencies==cloud-config-server,actuator \
|
||||
dependencies==cloud-config-server,actuator,cloud-eureka \
|
||||
--output configserver.zip
|
||||
RUN mkdir configserver && unzip -d configserver configserver.zip
|
||||
COPY metadata metadata
|
||||
|
@ -27,7 +27,8 @@ RUN for patch in patches/*.patch; do \
|
|||
done
|
||||
RUN configserver/gradlew bootJar --project-dir configserver --no-daemon
|
||||
RUN mkdir output && \
|
||||
cp "configserver/build/libs/configserver-$(cat metadata/IMAGE_VERSION).jar" output/configserver.jar
|
||||
cp "configserver/build/libs/configserver-$(cat metadata/IMAGE_VERSION).jar" output/configserver.jar && \
|
||||
cp configserver/src/main/resources/application.properties output/application.properties
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Spring Config Server Linux Image
|
||||
|
@ -37,4 +38,4 @@ FROM eclipse-temurin:21
|
|||
WORKDIR /config-server
|
||||
COPY --from=build /scratch/output .
|
||||
EXPOSE 8888
|
||||
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "configserver.jar"]
|
||||
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.config.location=/config-server/application.properties", "-jar", "configserver.jar"]
|
||||
|
|
|
@ -1 +1 @@
|
|||
4.1.0
|
||||
4.1.1
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
--- configserver/src/main/resources/application.properties 2024-02-21 15:43:09.000000000 -0600
|
||||
+++ configserver/src/main/resources/application.properties 2024-02-21 16:39:57.534331200 -0600
|
||||
@@ -1 +1 @@
|
||||
-
|
||||
+++ configserver/src/main/resources/application.properties 2024-04-02 13:15:18.461432100 -0500
|
||||
@@ -0,0 +1,9 @@
|
||||
+server.port = 8888
|
||||
+spring.cloud.config.server.git.uri = https://github.com/spring-cloud-samples/config-repo
|
||||
+eureka.client.enabled = false
|
||||
+eureka.client.fetchRegistry = false
|
||||
+eureka.client.serviceUrl.defaultZone=http://host.docker.internal:8761/eureka
|
||||
+eureka.instance.appname = configserver
|
||||
+eureka.instance.virtualhostname = configserver
|
||||
+eureka.instance.hostname = host.docker.internal
|
||||
+eureka.instance.instanceId = host.docker.internal:configserver:8888
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
--- configserver/src/main/java/io/steeltoe/docker/configserver/ConfigServer.java 2024-02-21 13:33:04.000000000 -0600
|
||||
+++ configserver/src/main/java/io/steeltoe/docker/configserver/ConfigServer.java 2024-02-21 13:40:40.622446300 -0600
|
||||
@@ -1,12 +1,21 @@
|
||||
+++ configserver/src/main/java/io/steeltoe/docker/configserver/ConfigServer.java 2024-04-02 13:40:40.622446300 -0600
|
||||
@@ -1,12 +1,23 @@
|
||||
package io.steeltoe.docker.configserver;
|
||||
|
||||
+import org.slf4j.Logger;
|
||||
+import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
+import org.springframework.cloud.config.server.EnableConfigServer;
|
||||
|
||||
@SpringBootApplication
|
||||
+@EnableConfigServer
|
||||
+@EnableDiscoveryClient
|
||||
public class ConfigServer {
|
||||
|
||||
+ private static final Logger logger = LoggerFactory.getLogger(ConfigServer.class);
|
||||
|
@ -21,4 +23,3 @@
|
|||
+ logger.info("{} {} by {}", pkg.getImplementationTitle(), pkg.getImplementationVersion(), pkg.getImplementationVendor());
|
||||
SpringApplication.run(ConfigServer.class, args);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ WORKDIR /scratch
|
|||
RUN apk add httpie && apk add patch
|
||||
RUN http https://start.spring.io/starter.zip \
|
||||
type==gradle-project \
|
||||
platformVersion==3.2.2 \
|
||||
platformVersion==3.2.4 \
|
||||
jvmVersion==21 \
|
||||
groupId==io.steeltoe.docker \
|
||||
artifactId==eurekaserver \
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
image: steeltoeoss/eureka-server:2.0.1
|
||||
tags: ['latest', '2', '2.0']
|
||||
manifests:
|
||||
- image: steeltoeoss/eureka-server-amd64-linux:2.0.1
|
||||
platform:
|
||||
os: linux
|
||||
architecture: amd64
|
|
@ -1 +1 @@
|
|||
4.1.0
|
||||
4.1.1
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
--- eurekaserver/src/main/resources/application.properties 2024-02-21 15:43:09.000000000 -0600
|
||||
+++ eurekaserver/src/main/resources/application.properties 2024-02-21 16:39:57.534331200 -0600
|
||||
@@ -1 +1,4 @@
|
||||
-
|
||||
+++ eurekaserver/src/main/resources/application.properties 2024-04-02 13:15:18.461432100 -0500
|
||||
@@ -0,0 +1,8 @@
|
||||
+server.port = 8761
|
||||
+eureka.client.fetch-registry = false
|
||||
+eureka.client.register-with-eureka = false
|
||||
+eureka.server.enable-self-preservation = false
|
||||
+eureka.server.evictionIntervalTimerInMs = 1000
|
||||
+eureka.server.responseCacheUpdateIntervalMs = 1000
|
||||
+eureka.server.wait-time-in-ms-when-sync-empty = 0
|
||||
+logging.level.com.netflix.eureka = TRACE
|
||||
|
|
Загрузка…
Ссылка в новой задаче