diff --git a/Dockerfile b/Dockerfile
index c093f6e..83845eb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,22 +3,30 @@
## buyilding-end install applications:
##
######################################################################################
-FROM archlinux:base-devel AS builder
+FROM archlinux:base-devel AS common
# update system
RUN pacman -Syu --noconfirm && pacman-db-upgrade \
- && pacman -S --noconfirm jdk-openjdk maven pnpm \
+ && pacman -S --noconfirm jdk-openjdk \
&& pacman -Scc --noconfirm
-ENV PATH /workspace/node_modules/.bin:$PATH
-WORKDIR /workspace
+WORKDIR /tmp
+
+FROM common AS builder
+# update system
+RUN pacman -Syu --noconfirm && pacman-db-upgrade \
+ && pacman -S --noconfirm maven npm pnpm \
+ && pacman -Scc --noconfirm
+
+ENV PATH /tmp/node_modules/.bin:$PATH
######################################################################################
##
## Build back:
##
######################################################################################
-FROM builder AS buildBack
-COPY back/pom.xml back/Formatter.xml ./
+FROM builder AS build_back
+COPY back/pom.xml ./
+COPY back/Formatter.xml ./
COPY back/src ./src/
RUN mvn clean compile assembly:single
@@ -27,27 +35,44 @@ RUN mvn clean compile assembly:single
## Build front:
##
######################################################################################
-FROM builder AS buildFront
+FROM builder AS dependency_front
RUN echo "@kangaroo-and-rabbit:registry=https://gitea.atria-soft.org/api/packages/kangaroo-and-rabbit/npm/" > /root/.npmrc
ADD front/package.json \
- front/karma.conf.js \
- front/protractor.conf.js \
+ front/pnpm-lock.yaml \
./
+ADD front/src/theme ./src/theme
# install and cache app dependencies
-RUN pnpm install
+RUN pnpm install --prod=false
-ADD front/e2e \
- front/tsconfig.json \
- front/tslint.json \
- front/angular.json \
- ./
-ADD front/src ./src
+###############################################################
+## Install sources
+###############################################################
+FROM dependency_front AS load_sources_front
-# generate build
-RUN ng build --output-path=dist --configuration=production --base-href=/karso/ --deploy-url=/karso/ karso
+# JUST to get the vertion of the application and his sha...
+COPY front/build.js \
+ front/version.txt \
+ front/tsconfig.json \
+ front/tsconfig.node.json \
+ front/vite.config.mts \
+ front/index.html \
+ ./
+COPY front/public ./public
+COPY front/src ./src
+
+#We are not in prod mode ==> we need to overwrite the production env.
+ARG env=front/.env.production
+COPY ${env} .env
+
+###############################################################
+## Build the sources
+###############################################################
+FROM load_sources_front AS build_front
+# build in bundle mode all the application
+RUN pnpm static:build
######################################################################################
##
@@ -55,19 +80,28 @@ RUN ng build --output-path=dist --configuration=production --base-href=/karso/ -
##
######################################################################################
-FROM bellsoft/liberica-openjdk-alpine:latest
-# add wget to manage the health check...
-RUN apk add --no-cache wget
+#FROM bellsoft/liberica-openjdk-alpine:latest
+## add wget to manage the health check...
+#RUN apk add --no-cache wget
+FROM common
-ENV LANG=C.UTF-8
+#FROM archlinux:base
+#RUN pacman -Syu --noconfirm && pacman-db-upgrade
+## install package
+#RUN pacman -S --noconfirm jdk-openjdk wget
+## intall npm
+#RUN pacman -S --noconfirm npm
+## clean all the caches Need only on the release environment
+#RUN pacman -Scc --noconfirm
-COPY --from=buildBack /workspace/out/maven/*.jar /application/application.jar
-COPY --from=buildFront /workspace/dist /application/front/
+ENV LANG C.UTF-8
+
+COPY --from=build_back /tmp/out/maven/*.jar /application/application.jar
+COPY --from=build_front /tmp/dist /application/front/
WORKDIR /application/
EXPOSE 80
-
# To verify health-check: docker inspect --format "{{json .State.Health }}" YOUR_SERVICE_NAME | jq
HEALTHCHECK --start-period=30s --start-interval=5s --interval=30s --timeout=5s --retries=10 \
CMD wget --no-verbose --tries=1 --spider http://localhost:80/karso/api/health_check || exit 1
diff --git a/back/pom.xml b/back/pom.xml
index d690f7b..b3328ec 100644
--- a/back/pom.xml
+++ b/back/pom.xml
@@ -20,7 +20,7 @@
kangaroo-and-rabbit
archidata
- 0.23.4
+ 0.23.6