-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (33 loc) · 1.55 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# To build and run:
# build stage
FROM gradle:8.7-jdk21-alpine AS builder
WORKDIR /app
COPY . .
RUN gradle bootJar
# build runtime
FROM eclipse-temurin:21-jre-alpine
# Install curl
RUN apk add --no-cache curl
ARG JAR_FILE=/app/build/libs/app*.jar
COPY --from=builder $JAR_FILE /app.jar
# Download do OpenTelemetry Java Agent
RUN wget -O /opentelemetry-javaagent.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.4.0/opentelemetry-javaagent.jar
# Download do Elastic APM Java Agent
#RUN wget -O /apm-agent.jar https://repo1.maven.org/maven2/co/elastic/apm/elastic-apm-agent/1.49.0/elastic-apm-agent-1.49.0.jar
COPY --from=docker.elastic.co/observability/apm-agent-java:latest /usr/agent/elastic-apm-agent.jar /apm-agent.jar
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
ENTRYPOINT [ "java", \
"-javaagent:/apm-agent.jar", \
"-Delastic.apm.service_name=admin-do-catalogo", \
"-Delastic.apm.server_url=http://apm-codeflix:8200", \
"-Delastic.apm.application_packages=com.lukinhasssss", \
"-Delastic.apm.capture_body=all", \
"-Delastic.apm.environment=codeflix", \
"-javaagent:/opentelemetry-javaagent.jar", \
"-Dotel.service.name=admin-do-catalogo", \
"-Dotel.exporter.otlp.endpoint=http://jaeger-codeflix:4318", \
"-Dotel.trace.exporter=zipkin", \
"-Dotel.trace.exporter.zipkin.endpoint=http://jaeger-codeflix:9411/api/v2/spans", \
"-jar", "/app.jar" \
]