karusic/Dockerfile

81 lines
2.3 KiB
Docker
Raw Permalink Normal View History

2022-06-19 19:24:04 +02:00
######################################################################################
##
## buyilding-end install applications:
##
######################################################################################
FROM archlinux:base-devel AS builder
# update system
RUN pacman -Syu --noconfirm && pacman-db-upgrade \
2024-04-07 19:22:46 +02:00
&& pacman -S --noconfirm jdk-openjdk maven npm pnpm \
2022-06-19 19:24:04 +02:00
&& 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:
##
######################################################################################
FROM builder AS buildFront
2024-04-07 19:22:46 +02:00
RUN echo "@kangaroo-and-rabbit:registry=https://gitea.atria-soft.org/api/packages/kangaroo-and-rabbit/npm/" > /root/.npmrc
ADD front/package.json \
2022-06-19 19:24:04 +02:00
front/karma.conf.js \
front/protractor.conf.js \
/tmp/
# install and cache app dependencies
2024-04-07 19:22:46 +02:00
RUN pnpm install
2022-06-19 19:24:04 +02:00
ADD front/e2e \
front/tsconfig.json \
front/tslint.json \
front/angular.json \
/tmp/
ADD front/src /tmp/src
# generate build
2022-07-15 15:09:08 +02:00
RUN ng build --output-path=dist --configuration=production --base-href=/karusic/ --deploy-url=/karusic/
2022-06-19 19:24:04 +02:00
######################################################################################
##
## Production area:
##
######################################################################################
FROM bellsoft/liberica-openjdk-alpine:latest
# add wget to manage the health check...
RUN apk add --no-cache wget
#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
ENV LANG=C.UTF-8
COPY --from=buildBack /tmp/out/maven/*.jar /application/application.jar
COPY --from=buildFront /tmp/dist /application/front/
2022-06-19 19:24:04 +02:00
WORKDIR /application/
EXPOSE 80
2022-06-19 19:24:04 +02:00
2022-07-15 15:09:08 +02:00
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karusic.WebLauncher"]