Skip to content

Commit

Permalink
Idlogik lookup docker integration (#35)
Browse files Browse the repository at this point in the history
* added initial Dockerfile

* workflow file for building idlogik recommender
  • Loading branch information
fmatthies authored Nov 28, 2024
1 parent 0a0f90a commit 099c185
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/build_idlogik_recommender_manually.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build specific AHD Recommender Version

on:
workflow_dispatch:
inputs:
version:
description: 'Version tag suffix of the resulting docker image'
default: 'latest'
required: true
type: string

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/inception-idlogik-recommender

jobs:
build-and-push-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # automatically generated

- name: downcase IMAGE_NAME
run: |
echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: ./id_logik_lookup
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.version }}
14 changes: 14 additions & 0 deletions id_logik_lookup/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM maven:3.9.9-amazoncorretto-17 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
COPY lib ./lib
RUN mvn clean package -DskipTests

FROM amazoncorretto:17
WORKDIR /inception_idlogik_recommender
COPY --from=build /app/target/id-logik-recommender.jar .

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "id-logik-recommender.jar"]
4 changes: 3 additions & 1 deletion id_logik_lookup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@
</dependency>
</dependencies>

<packaging>jar</packaging>

<build>
<finalName>id-logik-recommender</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
Expand All @@ -136,5 +139,4 @@
</plugin>
</plugins>
</build>

</project>

0 comments on commit 099c185

Please sign in to comment.