Skip to content

Commit

Permalink
Merge pull request #25 from CDOT-CV/dev
Browse files Browse the repository at this point in the history
Java Update & DockerHub Image Documentation
  • Loading branch information
dan-du-car authored Jan 30, 2024
2 parents ea0ddca + 1f2a6a7 commit cb1d664
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
jpo-security-svcs:
runs-on: ubuntu-latest
container:
image: openjdk:17-jdk-slim-buster
image: maven:3.8-eclipse-temurin-21-alpine
options: --user root
steps:
- name: Checkout ${{ github.event.repository.name }}
Expand All @@ -18,7 +18,7 @@ jobs:
maven-version: 3.8.2
- uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '21'
distribution: 'temurin'
- name: Build
run: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM maven:3.5.4-jdk-8-alpine as builder
FROM maven:3.8-eclipse-temurin-21-alpine as builder

WORKDIR /home
COPY ./pom.xml .
COPY ./src ./src

RUN mvn clean package

FROM eclipse-temurin:11-jre-alpine
FROM eclipse-temurin:21-jre-alpine

RUN apk update
RUN apk add ca-certificates
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# DOCKER_SHARED_VOLUME_WINDOWS should be defined for Windows host machine as C: and not defined for Linux hosts

version: '3'
services:
sec:
Expand Down
54 changes: 54 additions & 0 deletions docs/dockerhub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# jpo-security-svcs

## GitHub Repository Link
https://github.com/usdot-jpo-ode/jpo-security-svcs

## Purpose
The purpose of the jpo-security-svcs program is to provide a REST endpoint for signing TIMs.

## How to pull the latest image
The latest image can be pulled using the following command:
> docker pull usdotjpoode/jpo-security-svcs:latest
## Required environment variables
- SEC_USE_CERTIFICATES

## Expected files/directories
The following should get mounted when running the container:
- creds/
- cert.jks
- logback.xml

## Direct Dependencies
None

## Indirect Dependencies
The SEC will not receive messages to process if the ODE is not running.

## Example docker-compose.yml with direct dependencies:
```
version: '3'
services:
sec:
image: usdotjpoode/jpo-security-svcs:release_q3
ports:
- "8090:8090"
environment:
SEC_CRYPTO_SERVICE_BASE_URI: ${SEC_CRYPTO_SERVICE_BASE_URI}
SEC_CRYPTO_SERVICE_ENDPOINT_SIGN_PATH: ${SEC_CRYPTO_SERVICE_ENDPOINT_SIGN_PATH}
SEC_USE_CERTFICATES: ${SEC_USE_CERTFICATES}
SEC_KEY_STORE_PASSWORD: ${SEC_KEY_STORE_PASSWORD}
volumes:
- ./creds:/usr/local/share/ca-certificates
- ./cert.jks:/home/cert.jks
- ./logback.xml:/home/logback.xml
command: sh -c "update-ca-certificates && java -Dlogback.configurationFile=/home/logback.xml -jar /home/jpo-security-svcs.jar"
logging:
options:
max-size: "10m"
max-file: "5"
```

## Expected startup output
The latest line in the logs should look like this:
> jpo-security-svcs-sec-1 | 2023-11-09 18:09:35 [main] INFO Application - Started Application in 2.569 seconds (JVM running for 3.274)
53 changes: 18 additions & 35 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
<version>3.1.3</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

Expand All @@ -17,7 +17,7 @@
<name>jpo-security-svcs</name>
<description>JPO ODE Cryptography Module</description>
<properties>
<java.version>1.8</java.version>
<java.version>21</java.version>
<jmockit.version>1.49</jmockit.version>
<argLine>-javaagent:${user.home}/.m2/repository/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar</argLine>
<sonar.organization>usdot-jpo-ode-1</sonar.organization>
Expand All @@ -40,27 +40,27 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>1.31</version>
<version>${jmockit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -73,36 +73,19 @@
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>${jmockit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.11</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.projectreactor</groupId>
<artifactId>reactor-spring</artifactId>
<version>1.0.1.RELEASE</version>
</dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.11</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.projectreactor</groupId>
<artifactId>reactor-spring</artifactId>
<version>1.0.1.RELEASE</version>
</dependency>
</dependencies>

<build>
Expand Down

0 comments on commit cb1d664

Please sign in to comment.