2022-12-29 21:15:49 +01:00
|
|
|
######################################################################################
|
|
|
|
##
|
|
|
|
## buyilding-end install applications:
|
|
|
|
##
|
|
|
|
######################################################################################
|
|
|
|
FROM archlinux:base-devel AS builder
|
|
|
|
# update system
|
|
|
|
RUN pacman -Syu --noconfirm && pacman-db-upgrade \
|
|
|
|
&& pacman -S --noconfirm jdk-openjdk maven npm \
|
|
|
|
&& pacman -Scc --noconfirm
|
|
|
|
|
|
|
|
ENV PATH /tmp/node_modules/.bin:$PATH
|
|
|
|
WORKDIR /tmp
|
|
|
|
|
|
|
|
######################################################################################
|
|
|
|
##
|
|
|
|
## Build back:
|
|
|
|
##
|
|
|
|
######################################################################################
|
|
|
|
FROM builder AS buildBack
|
|
|
|
COPY back/pom.xml /tmp
|
|
|
|
COPY back/src /tmp/src/
|
|
|
|
RUN mvn clean compile assembly:single
|
|
|
|
|
|
|
|
######################################################################################
|
|
|
|
##
|
|
|
|
## Build front:
|
|
|
|
##
|
|
|
|
######################################################################################
|
2022-12-30 09:14:05 +01:00
|
|
|
#FROM builder AS buildFront
|
2022-12-29 21:15:49 +01:00
|
|
|
|
2022-12-30 09:14:05 +01:00
|
|
|
#ADD front/package-lock.json \
|
|
|
|
# front/package.json \
|
|
|
|
# front/karma.conf.js \
|
|
|
|
# front/protractor.conf.js \
|
|
|
|
# /tmp/
|
2022-12-29 21:15:49 +01:00
|
|
|
|
|
|
|
# install and cache app dependencies
|
2022-12-30 09:14:05 +01:00
|
|
|
#RUN npm install
|
2022-12-29 21:15:49 +01:00
|
|
|
|
2022-12-30 09:14:05 +01:00
|
|
|
#ADD front/e2e \
|
|
|
|
# front/tsconfig.json \
|
|
|
|
# front/tslint.json \
|
|
|
|
# front/angular.json \
|
|
|
|
# /tmp/
|
|
|
|
#ADD front/src /tmp/src
|
2022-12-29 21:15:49 +01:00
|
|
|
|
|
|
|
# generate build
|
2022-12-30 09:14:05 +01:00
|
|
|
#RUN ng build --output-path=dist --configuration=production --base-href=/karanage/ --deploy-url=/karanage/
|
2022-12-29 21:15:49 +01:00
|
|
|
|
|
|
|
######################################################################################
|
|
|
|
##
|
|
|
|
## Production area:
|
|
|
|
##
|
|
|
|
######################################################################################
|
|
|
|
|
|
|
|
FROM bellsoft/liberica-openjdk-alpine:latest
|
|
|
|
# add wget to manage the health check...
|
|
|
|
RUN apk add --no-cache wget
|
|
|
|
|
|
|
|
ENV LANG=C.UTF-8
|
|
|
|
|
|
|
|
COPY --from=buildBack /tmp/out/maven/*.jar /application/application.jar
|
2022-12-30 09:14:05 +01:00
|
|
|
#COPY --from=buildFront /tmp/dist /application/front/
|
2022-12-29 21:15:49 +01:00
|
|
|
|
|
|
|
WORKDIR /application/
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
2022-12-30 09:14:05 +01:00
|
|
|
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karanage.WebLauncher"]
|