optimize setup
Some checks failed
deploy to hetzner / deploy (push) Failing after 11m28s

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-08-23 00:09:16 +02:00
parent feb96d32b6
commit f86b2792ef
6 changed files with 22 additions and 23 deletions

View File

@@ -11,7 +11,7 @@ USER app
# Copy all needed project files to a folder # Copy all needed project files to a folder
COPY --chown=app ./gradle/ ./gradle COPY --chown=app ./gradle/ ./gradle
COPY --chown=app ./gradlew ./build.gradle ./settings.gradle ./app.json ./ COPY --chown=app ./gradlew ./build.gradle ./settings.gradle ./
COPY --chown=app ./src ./src COPY --chown=app ./src ./src
RUN curl -OL https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar RUN curl -OL https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
@@ -28,10 +28,6 @@ USER app
COPY --chown=app --from=build /usr/src/app/build/libs/*-SNAPSHOT.jar /usr/app/eureka.jar COPY --chown=app --from=build /usr/src/app/build/libs/*-SNAPSHOT.jar /usr/app/eureka.jar
COPY --chown=app --from=build /usr/src/app/opentelemetry-javaagent.jar /usr/app/opentelemetry-javaagent.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="eureka-service"
ENV OTEL_EXPORTER_OTLP_ENDPOINT="http://opentelemetry-collector.web:4318"
HEALTHCHECK CMD curl --fail http://localhost:8761/actuator/health/liveness || exit 1 HEALTHCHECK CMD curl --fail http://localhost:8761/actuator/health/liveness || exit 1
EXPOSE 8761 EXPOSE 8761

17
Makefile Normal file
View File

@@ -0,0 +1,17 @@
REMOTE_HOST = mars3142@172.16.20.1
PROJECT_NAME = firmware-hq
SERVICE_NAME = eureka-service
RASPI_PATH = /mnt/data/${PROJECT_NAME}
install: build deploy import
build:
docker buildx build --platform linux/arm64 --no-cache -t ${PROJECT_NAME}/${SERVICE_NAME}:latest -o type=docker,dest=./${SERVICE_NAME}-arm64.tar .
deploy:
scp ./${SERVICE_NAME}-arm64.tar ${REMOTE_HOST}:${RASPI_PATH}/
import:
ssh ${REMOTE_HOST} "sudo docker load -i ${RASPI_PATH}/${SERVICE_NAME}-arm64.tar && rm ${RASPI_PATH}/${SERVICE_NAME}-arm64.tar"
.PHONY: build deploy import

View File

@@ -1,14 +0,0 @@
{
"healthchecks": {
"web": [
{
"type": "readiness",
"name": "web check",
"description": "Checking if the app responds to the /actuator/health/readiness endpoint",
"path": "/actuator/health/readiness",
"port": 8761,
"attempts": 3
}
]
}
}

View File

@@ -22,10 +22,10 @@ ext {
} }
dependencies { dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server'
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
developmentOnly 'org.springframework.boot:spring-boot-devtools' developmentOnly 'org.springframework.boot:spring-boot-devtools'
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
} }

BIN
eureka-service-arm64.tar Normal file

Binary file not shown.

View File

@@ -44,5 +44,5 @@ eureka:
fetchRegistry: false fetchRegistry: false
serviceUrl: serviceUrl:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
datacenter: hel1-dc2 datacenter: rpi5-1
environment: production environment: production