This commit is contained in:
2026-04-24 14:27:10 +07:00
parent 751f3aefe4
commit 7749e18f4c
14 changed files with 3778 additions and 373 deletions
+10 -6
View File
@@ -1,17 +1,22 @@
# Stage 1: Build the application
FROM maven:3.8.6-openjdk-11 AS build
# Install Node.js and Grunt (required by the prod profile for JS/CSS compilation)
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install -y nodejs && \
npm install -g grunt-cli
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN mvn clean package -DskipTests -pl docs-web -am
# Build with the 'prod' profile so Grunt compiles JS/CSS into dist/
RUN mvn clean package -DskipTests -Pprod -pl docs-web -am
# Stage 2: Runtime environment
FROM ubuntu:22.04
LABEL maintainer="b.gamard@sismics.com"
# Run Debian in non interactive mode
ENV DEBIAN_FRONTEND noninteractive
# Configure env
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
@@ -52,9 +57,8 @@ RUN mkdir /app && \
# Copy build artifacts from Stage 1
COPY --from=build /usr/src/app/docs.xml /app/webapps/docs.xml
COPY --from=build /usr/src/app/docs-web/target/docs-web-*.war /app/webapps/docs.war
COPY --from=build /usr/src/app/docs-web/target/docs-web-1.12-SNAPSHOT.war /app/webapps/docs.war
WORKDIR /app
CMD ["java", "-jar", "/opt/jetty/start.jar"]