Skip to content

Commit

Permalink
update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
barais committed Jan 12, 2024
1 parent 8682fbd commit c65bbb8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Java CI with Maven

on:
push:
branches: [ develop1 ]
branches: [ develop ]

jobs:
build:
Expand All @@ -14,11 +14,25 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml -Pnative
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./
file: ./src/main/docker/Dockerfile.native
push: true
tags: barais/grade-scope-istic:develop
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
Expand Down
13 changes: 8 additions & 5 deletions src/main/docker/Dockerfile.build.amd64
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
FROM ghcr.io/graalvm/graalvm-ce:ol9-java11 AS build-step
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-21 AS build-step
USER root
WORKDIR /app
RUN gu install native-image
# RUN gu install native-image
RUN microdnf install git -y
RUN git clone https://github.com/correctexam/corrigeExamBack
WORKDIR /app/corrigeExamBack
RUN git checkout develop
WORKDIR /app/corrigeExamBack

RUN mkdir -p /opt/maven
WORKDIR /opt/maven
RUN curl -O "https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz" && tar xzvf "apache-maven-3.6.3-bin.tar.gz" && rm "apache-maven-3.6.3-bin.tar.gz"
RUN curl -O "https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz" && tar xzvf "apache-maven-3.9.6-bin.tar.gz" && rm "apache-maven-3.9.6-bin.tar.gz"

WORKDIR /app/corrigeExamBack
RUN /opt/maven/apache-maven-3.6.3/bin/mvn package -Pnative
RUN /opt/maven/apache-maven-3.9.6/bin/mvn package -Pnative

FROM oraclelinux:9-slim as prod
FROM quay.io/quarkus/quarkus-micro-image:2.0-amd64 as prod
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/Dockerfile.native
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# docker run -i --rm -p 8080:8080 quarkus/grade-scope-istic
#
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3
FROM quay.io/quarkus/quarkus-micro-image:2.0-amd64
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
Expand Down
1 change: 1 addition & 0 deletions src/main/java/fr/istic/service/ExamService.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public Optional<ExamDTO> findOne(Long id) {
*/
@Transactional
public Paged<ExamDTO> findAll(Page page) {

log.debug("Request to get all Exams");
return new Paged<>(Exam.findAll().page(page))
.map(exam -> examMapper.toDto((Exam) exam));
Expand Down

0 comments on commit c65bbb8

Please sign in to comment.