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