Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18 förvaltning av gamla beroenden 1 #33

Merged
merged 4 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/adoptopenjdk/openjdk11:jdk-11.0.2.9-slim AS build
FROM docker.io/library/openjdk:17-jdk-slim AS build

RUN mkdir /build
COPY pom.xml /build/
Expand All @@ -11,7 +11,7 @@ RUN ./mvnw clean package spring-boot:repackage


# Note: The default non root chainguard user is 65532
FROM cgr.dev/chainguard/jdk:openjdk-jre-11-20221109
FROM cgr.dev/chainguard/jdk:latest

USER root
RUN mkdir -p /opt/.logs \
Expand All @@ -23,6 +23,9 @@ COPY --from=build /build/target/dcat-ap-processor-0.0.2-SNAPSHOT.jar /opt/app.ja

ENV JDK_JAVA_OPTIONS -Duser.language=sv-SE -Duser.region=SE -Duser.timezone=Europe/Stockholm
WORKDIR /opt
USER root
RUN chmod +x app.jar
USER 65532
ENV PORT 8080
EXPOSE 8080
CMD ["-jar","app.jar"]
CMD ["java","-jar","app.jar"]
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Bygg en container image från koden i det här repositoryt, t.ex:
```
docker build --no-cache -t "dcatprocessor" .
```

docker run -it --rm -p 8080:8080 dcatprocessor:latest

När container startas finns ett formulär och ett REST API tillgängligt att använda efter behov.

Alternativt, finns det också en experimentell färdigbyggd image för att testa.
Expand Down
28 changes: 19 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.5</version>
<version>3.2.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>se.af</groupId>
Expand All @@ -30,8 +30,9 @@
<name>dcat-ap-processor</name>
<description>Preprocessor - DCAT-AP-SE metadata</description>
<properties>
<java.version>11</java.version>
<java.version>17</java.version>
<argLine>-Dfile.encoding=UTF-8</argLine>
<!--<spring-security.version>5.8</spring-security.version>-->
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -75,20 +76,14 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.2</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/com.mopano/hibernate-json-org-contributor -->
<dependency>
<groupId>com.mopano</groupId>
<artifactId>hibernate-json-org-contributor</artifactId>
<version>1.0</version>
</dependency>

<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
Expand All @@ -109,6 +104,21 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>8.0.0</version>
<configuration>
<goalPrefix>dependency-check</goalPrefix>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable
%black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1}): %msg%n%throwable
</Pattern>
</layout>
</appender>
Expand All @@ -34,7 +34,7 @@
<file>${LOGS}/dcatprocessor.log</file>
<encoder
class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
<Pattern>%d %p %C{1} [%t] %m%n</Pattern>
</encoder>

<rollingPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.web.server.LocalServerPort;

import se.ams.dcatprocessor.testutil.TestHelper;

Expand Down
Loading