[R10] Add docker workflow

This commit is contained in:
Mirna Gama 2024-01-29 17:57:23 -03:00 committed by Mirna Gama
parent b9706a4a64
commit 0b053a99c6
2 changed files with 16 additions and 1 deletions

View File

@ -28,4 +28,15 @@ jobs:
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package -DJWT_SECRET=${{ secrets.JWT_SECRET }} --file pom.xml
run: mvn -B package -Dspring.profiles.active=test -DJWT_SECRET=${{ secrets.JWT_SECRET }} --file pom.xml
- name: Build & push Docker image
uses: mr-smithers-excellent/docker-build-push@v5
with:
image: mbgama/hospital-management-api
tags: latest
registry: docker.io
dockerfile: Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

4
Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM eclipse-temurin:17-jdk-alpine
VOLUME /tmp
COPY target/*.jar /app/hospital-management-api.jar
ENTRYPOINT ["java", "-jar","/app/hospital-management-api.jar"]