Added dockerfile build

This commit is contained in:
Max W 2023-12-06 14:06:39 +01:00
parent d1f23b1969
commit 1e1c14f75a
2 changed files with 16 additions and 0 deletions

View File

@ -18,8 +18,19 @@ jobs:
distribution: 'adopt'
- name: Grant execute permission for mvnw
run: chmod +x ./mvnw
- name: Build with Maven
run: ./mvnw package spring-boot:repackage
- name: Build Docker image
run: docker build -t walzen665/spring-cicd-test:latest --build-arg="JAR_FILE=demo-0.0.1-SNAPSHOT-spring-boot.jar" .
- name: Log in to Gitea Docker Registry
run: echo ${{ secrets.GITEAREGISTRYTOKEN }} | docker login -u ${{ secrets.GITEAREGISTRYUSERNAME }} --password-stdin https://git.walzen665.de
- name: Push Docker Image to Gitea
run: docker push walzen665/spring-cicd-test:latest
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

5
Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM eclipse-temurin:17-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]