71 lines
2.0 KiB
Docker
71 lines
2.0 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=/karanage/ --deploy-url=/karanage/
|
|
|
|
######################################################################################
|
|
##
|
|
## 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
|
|
#COPY --from=buildFront /tmp/dist /application/front/
|
|
|
|
WORKDIR /application/
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karanage.WebLauncher"]
|