-
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.
breaking: upgrated version to java 21 (#76)
* ignore .idea * updated webconfig * removed application.properties * added springboot application.yml * added logback configurations * added logback configurations * upgrated pom.xml to java 21 * upgrated docker to java 21 * updated maven wrapper * updated docker image * updated docker image with best practice * disabled azdo step * disabled azdo step * pre-commit fixs * htlm page with new layout * better root controller * docker compose updated * docker compose updated * pre-commit fixs * Added pull request template
- Loading branch information
1 parent
3baa7f5
commit 863b84f
Showing
17 changed files
with
953 additions
and
596 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#### Description | ||
<!--- Please always add a PR description as if nobody knows anything about the context these changes come from. --> | ||
<!--- Even if we are all from our internal team, we may not be on the same page. --> | ||
<!--- Write this PR as you were contributing to a public OSS project, where nobody knows you and you have to earn their trust. --> | ||
<!--- This will improve our projects in the long run! Thanks. --> | ||
|
||
#### List of Changes | ||
<!--- Describe your changes in detail --> | ||
|
||
#### Motivation and Context | ||
<!--- Why is this change required? What problem does it solve? --> | ||
|
||
#### How Has This Been Tested? | ||
<!--- Please describe in detail how you tested your changes. --> | ||
<!--- Include details of your testing environment, tests ran to see how --> | ||
<!--- your change affects other areas of the code, etc. --> | ||
- Pre-Deploy Test | ||
- [ ] Unit | ||
- [ ] Integration (Narrow) | ||
- Post-Deploy Test | ||
- [ ] Isolated Microservice | ||
- [ ] Broader Integration | ||
- [ ] Acceptance | ||
- [ ] Performance & Load | ||
|
||
#### Types of changes | ||
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> | ||
|
||
- [ ] PATCH - Bug fix (backwards compatible bug fixes) | ||
- [ ] MINOR - New feature (add functionality in a backwards compatible manner) | ||
- [ ] MAJOR - Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
- [ ] CHORE - Minor Change (fix or feature that don't impact the functionality e.g. Documentation or lint configuration) | ||
|
||
#### Checklist: | ||
<!--- Go over all the following points, and put an `x` in all the boxes that apply. --> | ||
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> | ||
|
||
- [ ] My change requires a change to the documentation. | ||
- [ ] I have updated the documentation accordingly. |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
.terraform | ||
|
||
charts* | ||
|
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,19 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
wrapperVersion=3.3.2 | ||
distributionType=only-script | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip |
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,23 +1,47 @@ | ||
# | ||
# Build | ||
# | ||
FROM maven:3.8.4-jdk-11-slim as buildtime | ||
# Build stage | ||
FROM maven:3.9-amazoncorretto-21 AS builder | ||
|
||
WORKDIR /build | ||
COPY . . | ||
RUN --mount=type=cache,target=/root/.m2 mvn clean package -DskipTests | ||
|
||
RUN mvn clean package | ||
# Runtime stage | ||
FROM amazoncorretto:21-alpine3.20 | ||
|
||
# | ||
# Docker RUNTIME | ||
# | ||
FROM adoptopenjdk/openjdk11:alpine-jre as runtime | ||
|
||
VOLUME /tmp | ||
WORKDIR /app | ||
|
||
COPY --from=buildtime /build/target/*.jar /app/app.jar | ||
# The agent is enabled at runtime via JAVA_TOOL_OPTIONS. | ||
ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.2.7/applicationinsights-agent-3.2.7.jar /app/applicationinsights-agent.jar | ||
# Add dependencies for security and monitoring | ||
RUN apk add --no-cache \ | ||
curl \ | ||
tzdata \ | ||
&& addgroup -S javauser \ | ||
&& adduser -S javauser -G javauser | ||
|
||
# Copy application bundle | ||
COPY --from=builder /build/target/*.jar app.jar | ||
|
||
# Add Application Insights agent | ||
ADD --chmod=644 https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.17/applicationinsights-agent-3.4.17.jar applicationinsights-agent.jar | ||
|
||
# Configure permissions | ||
RUN chown -R javauser:javauser /app | ||
USER javauser | ||
|
||
# Configure JVM options for containerized environment | ||
ENV JAVA_TOOL_OPTIONS="-XX:MaxRAMPercentage=75.0 \ | ||
-XX:InitialRAMPercentage=50.0 \ | ||
-XX:+UseG1GC \ | ||
-Xlog:gc*:/app/gc.log \ | ||
-Djava.security.egd=file:/dev/./urandom \ | ||
-Duser.timezone=UTC" | ||
|
||
# Application Insights configuration | ||
ENV APPLICATIONINSIGHTS_CONNECTION_STRING="" | ||
ENV APPLICATIONINSIGHTS_ROLE_NAME="devops-java-springboot-color" | ||
|
||
# Configure container | ||
EXPOSE 8080 | ||
HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \ | ||
CMD curl -f http://localhost:8080/actuator/health || exit 1 | ||
|
||
ENTRYPOINT ["java","-jar","/app/app.jar"] | ||
ENTRYPOINT ["java", "-javaagent:/app/applicationinsights-agent.jar", "-jar", "/app/app.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
version: "3.8" | ||
services: | ||
devops-java-springboot-color: | ||
# image: "ghcr.io/pagopa/devops-java-springboot-color:0.6.0" | ||
# image: "ghcr.io/pagopa/devops-java-springboot-color:snapshot-upgrade-java-21" | ||
build: | ||
dockerfile: ./Dockerfile | ||
context: . | ||
container_name: devops-java-springboot-color | ||
restart: always | ||
environment: | ||
- MY_APP_COLOR=red | ||
# environment: | ||
# - MY_APP_COLOR=red | ||
ports: | ||
- "8080:8080" |
Oops, something went wrong.