-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-api
More file actions
40 lines (27 loc) · 1.22 KB
/
Dockerfile-api
File metadata and controls
40 lines (27 loc) · 1.22 KB
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
33
34
35
36
37
38
39
40
FROM maven:3.9.4-eclipse-temurin-21 AS build
# Install tzdata to support all timezones
RUN apt-get update && apt-get install -y tzdata \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copier le pom parent et tous les modules nécessaires pour Maven multi-modules
COPY pom.xml .
COPY itexpert-content-parent ./itexpert-content-parent
COPY itexpert-content-lib ./itexpert-content-lib
COPY itexpert-content-core ./itexpert-content-core
COPY itexpert-content-api ./itexpert-content-api
COPY itexpert-content-ui ./itexpert-content-ui
# Tu peux copier itexpert-content-ui si tu veux build le frontend ici, sinon non
# COPY itexpert-content-ui ./itexpert-content-ui
# Build complet Maven (cela construira tous les modules)
RUN mvn clean package -DskipTests
# Ensuite, image finale runtime (exemple pour api)
FROM eclipse-temurin:21
ENV APP_HOME=/app
RUN mkdir -p ${APP_HOME}/bin ${APP_HOME}/config ${APP_HOME}/logs
# Copier uniquement le jar API généré
COPY --from=build /app/itexpert-content-api/target/*.jar ${APP_HOME}/bin/app.jar
COPY itexpert-content-api/entrypoint.sh ${APP_HOME}
RUN chmod +x ${APP_HOME}/entrypoint.sh
EXPOSE 1080
ENTRYPOINT ["/app/entrypoint.sh"]
HEALTHCHECK CMD curl --fail http://localhost:1080/health || exit 1