Skip to content

Commit

Permalink
Fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-chmbn committed Apr 11, 2024
1 parent ed91f8a commit 5e8459b
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
:wq
###
# 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 API
#FROM tomcat:9-jdk11 as api-image
#COPY --from=build-image /build/web/target/*.war /usr/local/tomcat/webapps/ROOT.war
#CMD [ "catalina.sh", "run" ]
FROM eclipse-temurin:17-jre as api-recherche-image
WORKDIR /app/
COPY --from=build-image /build/target/*.jar /app/theses-api-recherche.jar
ENTRYPOINT ["java","-jar","/app/theses-api-recherche.jar"]

0 comments on commit 5e8459b

Please sign in to comment.