From 1bc8f17ac98aafbf38b4f2e0d93f55fbedc7f4aa Mon Sep 17 00:00:00 2001 From: Vegard Smines Date: Thu, 31 Aug 2023 11:00:52 +0200 Subject: [PATCH] Trying docker heroku deploy --- .github/workflows/main.yml | 25 ++++++++++++------------- Procfile | 2 +- dockerfile | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 882363b5..d51a796c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,18 +56,17 @@ jobs: name: Deploy to Heroku runs-on: ubuntu-latest needs: build - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Download production-ready build files - uses: actions/download-artifact@v3 - with: - name: production-files - - name: Deploy to Heroku - uses: akhileshns/heroku-deploy@v3.12.14 + steps: + - name: List root directory + run: ls -al + - name: Build, Push and Release a Docker container to Heroku + uses: gonuit/heroku-docker-deploy@v1.3.3 with: - heroku_api_key: ${{secrets.HEROKU_API_KEY}} - heroku_app_name: "jobjugglerapi" - heroku_email: "vegardrsmines@gmail.com" + email: ${{ secrets.HEROKU_EMAIL }} + heroku_api_key: ${{ secrets.HEROKU_API_KEY }} + heroku_app_name: jobjugglerapi + dockerfile_directory: ./ + dockerfile_name: dockerfile + docker_options: "--no-cache" + process_type: web \ No newline at end of file diff --git a/Procfile b/Procfile index 71cbd5ab..aab84e10 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: java -jar *.jar \ No newline at end of file +web: java -jar db-scheduler-ui-backend/target/*.jar diff --git a/dockerfile b/dockerfile new file mode 100644 index 00000000..4500895a --- /dev/null +++ b/dockerfile @@ -0,0 +1,14 @@ +# Use the official OpenJDK base image +FROM openjdk:17-jdk-slim + +# Set the working directory inside the container +WORKDIR /app + +# Copy the JAR file into the image +COPY ./db-scheduler-ui-backend/target/db-scheduler-ui-backend-0.0.1-SNAPSHOT.jar /app/app.jar + +# Expose port 8080 for the application +EXPOSE 8081 + +# Command to run the application +CMD ["java", "-jar", "/app/app.jar"]