optimize setup
Some checks failed
deploy to hetzner / deploy (push) Failing after 4m54s

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-08-23 00:13:03 +02:00
parent 7e53d48d41
commit 42157c4abc
3 changed files with 23 additions and 21 deletions

View File

@@ -11,13 +11,13 @@ USER app
# Copy all needed project files to a folder
COPY --chown=app ./.mvn/ .mvn
COPY --chown=app ./mvnw ./pom.xml ./app.json ./
COPY --chown=app ./mvnw ./pom.xml ./
COPY --chown=app ./src ./src
RUN curl -OL https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
# Build the production package
RUN ./mvnw --batch-mode clean verify -Pproduction -DskipTests
RUN ./mvnw --batch-mode clean verify -Pproduction -DskipTests
# Running stage: the part that is used for running the application
FROM eclipse-temurin:21-jre-noble
@@ -28,10 +28,6 @@ USER app
COPY --chown=app --from=build /usr/src/app/target/*.jar /usr/app/website.jar
COPY --chown=app --from=build /usr/src/app/opentelemetry-javaagent.jar /usr/app/opentelemetry-javaagent.jar
ENV JAVA_TOOL_OPTIONS="-javaagent:/usr/app/opentelemetry-javaagent.jar"
ENV OTEL_SERVICE_NAME="website"
ENV OTEL_EXPORTER_OTLP_ENDPOINT="http://opentelemetry-collector.web:4318"
HEALTHCHECK CMD curl --fail http://localhost:5000/actuator/health/liveness || exit 1
HEALTHCHECK CMD curl --fail http://localhost:8080/actuator/health || exit 1
CMD ["java", "-jar", "/usr/app/website.jar"]