From 19fd4cdeaca96de32a7c8c3d672d0e5f02042743 Mon Sep 17 00:00:00 2001 From: Jean Date: Mon, 19 Apr 2021 07:12:11 -0300 Subject: [PATCH] Subdir for Git context is not yet supported (moby/buildkit#1684) but you can use the path context in the meantime. More info on Docker docs website. --- .github/workflows/maven.yml | 20 ++++++++++---------- Dockerfile | 19 +++++++++++++++++++ cabal-neo-admin/Dockerfile | 19 ------------------- 3 files changed, 29 insertions(+), 29 deletions(-) create mode 100644 Dockerfile delete mode 100644 cabal-neo-admin/Dockerfile diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4e22b02..491df4b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -12,14 +12,14 @@ jobs: runs-on: ubuntu-latest steps: -# - uses: actions/checkout@v2 -# - name: Set up JDK 11 -# uses: actions/setup-java@v2 -# with: -# java-version: '11' -# distribution: 'adopt' -# - name: Build with Maven -# run: mvn -B package --file cabal-neo-admin/pom.xml + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: Build with Maven + run: mvn -B package --file cabal-neo-admin/pom.xml - uses: actions/checkout@v2 - name: Docker Login @@ -32,8 +32,8 @@ jobs: - name: Criando a Imagem Docker uses: docker/build-push-action@v2.3.0 with: - context: cabal-neo-admin - file: cabal-neo-admin/Dockerfile + context: . + file: . tags: | jeanlucafp/cabalneobackend:latest jeanlucafp/cabalneobackend:${{ github.run_number }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2cc9344 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# FROM maven:3.5-jdk-8 AS build + +# COPY src . + +# COPY pom.xml . + +# RUN mvn -f pom.xml clean package -Dmaven.test.skip=true + +FROM openjdk:11-jdk-buster + +ARG JAR_FILE=cabal-neo-admin/target/*.jar + +COPY ${JAR_FILE} app.jar + +ENV PORT 8080 + +EXPOSE $PORT + +ENTRYPOINT ["java","-jar","/app.jar"] \ No newline at end of file diff --git a/cabal-neo-admin/Dockerfile b/cabal-neo-admin/Dockerfile deleted file mode 100644 index e49a274..0000000 --- a/cabal-neo-admin/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM maven:3.5-jdk-8 AS build - -COPY src . - -COPY pom.xml . - -RUN mvn -f pom.xml clean package -Dmaven.test.skip=true - -FROM openjdk:11-jdk-buster - -ARG JAR_FILE=target/*.jar - -COPY ${JAR_FILE} app.jar - -ENV PORT 8080 - -EXPOSE $PORT - -ENTRYPOINT ["java","-jar","/app.jar"] \ No newline at end of file