80 lines
2.2 KiB
Docker
80 lines
2.2 KiB
Docker
######################################################################################
|
|
##
|
|
## 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:
|
|
##
|
|
######################################################################################
|
|
FROM builder AS buildFront
|
|
|
|
ADD front/package-lock.json \
|
|
front/package.json \
|
|
front/karma.conf.js \
|
|
front/protractor.conf.js \
|
|
/tmp/
|
|
|
|
# install and cache app dependencies
|
|
RUN npm install
|
|
|
|
ADD front/e2e \
|
|
front/tsconfig.json \
|
|
front/tslint.json \
|
|
front/angular.json \
|
|
/tmp/
|
|
ADD front/src /tmp/src
|
|
|
|
# generate build
|
|
RUN ng build --output-path=dist --configuration=production --base-href=/karideo/ --deploy-url=/karideo/
|
|
|
|
######################################################################################
|
|
##
|
|
## 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/karideo/
|
|
|
|
WORKDIR /application/
|
|
|
|
EXPOSE 18080
|
|
|
|
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karideo.WebLauncher"]
|