Compare commits
3 Commits
80dbbb90a0
...
main
Author | SHA1 | Date | |
---|---|---|---|
9bb7a2e764
|
|||
2ef81803c6
|
|||
53e79c0067
|
@@ -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/config.jar
|
COPY --chown=app --from=build /usr/src/app/build/libs/*-SNAPSHOT.jar /usr/app/config.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"
|
HEALTHCHECK CMD curl --fail http://localhost:8888/actuator/health || exit 1
|
||||||
ENV OTEL_SERVICE_NAME="config-service"
|
|
||||||
ENV OTEL_EXPORTER_OTLP_ENDPOINT="http://opentelemetry-collector.web:4318"
|
|
||||||
|
|
||||||
HEALTHCHECK CMD curl --fail http://localhost:5000/actuator/health || exit 1
|
|
||||||
|
|
||||||
CMD ["java", "-jar", "/usr/app/config.jar"]
|
CMD ["java", "-jar", "/usr/app/config.jar"]
|
||||||
|
20
Makefile
Normal file
20
Makefile
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
REMOTE_HOST = mars3142@172.16.20.1
|
||||||
|
PROJECT_NAME = firmware-hq
|
||||||
|
SERVICE_NAME = config-service
|
||||||
|
RASPI_PATH = /mnt/data/${PROJECT_NAME}
|
||||||
|
|
||||||
|
install: build deploy import cleanup
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
rm -f ${SERVICE_NAME}-arm64.tar
|
||||||
|
|
||||||
|
.PHONY: build deploy import cleanup
|
14
app.json
14
app.json
@@ -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": 5000,
|
|
||||||
"attempts": 3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
10
build.gradle
10
build.gradle
@@ -28,12 +28,12 @@ ext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.springframework.cloud:spring-cloud-config-server'
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
|
||||||
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
|
||||||
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
|
|
||||||
compileOnly 'org.projectlombok:lombok'
|
|
||||||
annotationProcessor 'org.projectlombok:lombok'
|
annotationProcessor 'org.projectlombok:lombok'
|
||||||
|
compileOnly 'org.projectlombok:lombok'
|
||||||
|
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||||
|
implementation 'org.springframework.cloud:spring-cloud-config-server'
|
||||||
|
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
}
|
}
|
||||||
|
@@ -17,9 +17,7 @@ spring:
|
|||||||
native:
|
native:
|
||||||
search-locations: classpath:/configurations
|
search-locations: classpath:/configurations
|
||||||
git:
|
git:
|
||||||
uri: https://github.com/${GIT_USER}/remote-config.git
|
uri: https://${GIT_LOGIN_USER}:${GIT_TOKEN}@${GIT_USER}/${GIT_REPO}/remote-config.git
|
||||||
username: ${GIT_USER}
|
|
||||||
password: ${GIT_TOKEN}
|
|
||||||
default-label: main
|
default-label: main
|
||||||
profiles:
|
profiles:
|
||||||
active: native
|
active: native
|
||||||
|
@@ -1,6 +1,3 @@
|
|||||||
server:
|
|
||||||
port: ${PORT:8080}
|
|
||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
enable-native-support: true
|
enable-native-support: true
|
||||||
api-docs:
|
api-docs:
|
||||||
@@ -46,7 +43,7 @@ spring:
|
|||||||
- RewritePath=/timezone-service/(?<segment>.*), /$\{segment}
|
- RewritePath=/timezone-service/(?<segment>.*), /$\{segment}
|
||||||
|
|
||||||
- id: google-service
|
- id: google-service
|
||||||
uri: ${GOOGLE_SERVICE_URI:http://google-service.web:8080}
|
uri: lb://google-service
|
||||||
predicates:
|
predicates:
|
||||||
- Path=/v1/account/**, /health/google, /google-service/v3/api-docs
|
- Path=/v1/account/**, /health/google, /google-service/v3/api-docs
|
||||||
filters:
|
filters:
|
||||||
@@ -54,9 +51,9 @@ spring:
|
|||||||
- RewritePath=/google-service/(?<segment>.*), /$\{segment}
|
- RewritePath=/google-service/(?<segment>.*), /$\{segment}
|
||||||
|
|
||||||
- id: token-service
|
- id: token-service
|
||||||
uri: ${BACKEND_SERVICE_URI:http://backend-service.web:8080}
|
uri: lb://backend-service
|
||||||
predicates:
|
predicates:
|
||||||
- Path=/v1/token/**, /health/backend, /token-service/v3/api-docs
|
- Path=/v1/token/**, /health/backend, /token-service/v3/api-docs
|
||||||
filters:
|
filters:
|
||||||
- RewritePath=/health/backend, /actuator/health
|
- RewritePath=/health/backend, /actuator/health
|
||||||
- RewritePath=/token-service/(?<segment>.*), /$\{segment}
|
- RewritePath=/token-service/(?<segment>.*), /$\{segment}
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
server:
|
|
||||||
port: ${PORT:8081}
|
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
server:
|
|
||||||
port: ${PORT:9000}
|
|
||||||
|
Reference in New Issue
Block a user