From 0b053a99c6072ba1f920677a5d9b55d1642c53cf Mon Sep 17 00:00:00 2001 From: Mirna Gama Date: Mon, 29 Jan 2024 17:57:23 -0300 Subject: [PATCH] [R10] Add docker workflow --- .github/workflows/maven.yml | 13 ++++++++++++- Dockerfile | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 48c206c..8a4da60 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d1a9341 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file