-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3497b8f
commit 9d7088f
Showing
8 changed files
with
60 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Run with: docker build -t products-service . | ||
FROM gradle:8.5.0-jdk21-alpine AS builder | ||
RUN mkdir -p /usr/src/products-service | ||
COPY . /usr/src/products-service | ||
WORKDIR /usr/src/products-service | ||
RUN ./gradlew bootJar | ||
|
||
FROM eclipse-temurin:21-jre-alpine | ||
COPY --from=builder /usr/src/products-service/build/libs/products-service-0.0.1-SNAPSHOT.jar /usr/app/products-service.jar | ||
EXPOSE 8080 | ||
ENTRYPOINT ["java","-jar","/usr/app/products-service.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rootProject.name = 'blog-otel-decoupled-monitoring' | ||
rootProject.name = 'products-service' |
24 changes: 23 additions & 1 deletion
24
...ankurchenko/blogoteldecoupledmonitoring/config/ApplicationElasticsearchConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,24 @@ | ||
package io.github.ivankurchenko.blogoteldecoupledmonitoring.config;public class ApplicationElasticsearchConfiguration { | ||
package io.github.ivankurchenko.blogoteldecoupledmonitoring.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.core.env.Environment; | ||
import org.springframework.data.elasticsearch.client.ClientConfiguration; | ||
import org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration; | ||
|
||
@Configuration | ||
public class ApplicationElasticsearchConfiguration extends ElasticsearchConfiguration { | ||
|
||
private final Environment environment; | ||
|
||
public ApplicationElasticsearchConfiguration(Environment environment) { | ||
this.environment = environment; | ||
} | ||
|
||
@Override | ||
public ClientConfiguration clientConfiguration() { | ||
var uri = environment.getProperty("spring.elasticsearch.rest.uri"); | ||
return ClientConfiguration.builder() | ||
.connectedTo(uri) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters