-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (29 loc) · 976 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
###
# Image pour la compilation
FROM maven:3-eclipse-temurin-17 as build-image
WORKDIR /build/
# Installation et configuration de la locale FR
RUN apt update && DEBIAN_FRONTEND=noninteractive apt -y install locales
RUN sed -i '/fr_FR.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG fr_FR.UTF-8
ENV LANGUAGE fr_FR:fr
ENV LC_ALL fr_FR.UTF-8
# On lance la compilation Java
# On débute par une mise en cache docker des dépendances Java
# cf https://www.baeldung.com/ops/docker-cache-maven-dependencies
COPY ./pom.xml /build/pom.xml
RUN mvn verify --fail-never
# et la compilation du code Java
COPY ./src/ /build/src/
RUN mvn --batch-mode -e \
-Dmaven.test.skip=false \
-Duser.timezone=Europe/Paris \
-Duser.language=fr \
package
###
# Image pour le module SEO
FROM eclipse-temurin:17-jre as seo-image
WORKDIR /app/
COPY --from=build-image /build/target/*.jar /app/theses-seo.jar
ENTRYPOINT ["java","-jar","/app/theses-seo.jar"]