[CI] correct the build
This commit is contained in:
parent
ac38ba284b
commit
ab949c1084
31
Dockerfile
31
Dockerfile
@ -6,11 +6,11 @@
|
||||
FROM archlinux:base-devel AS builder
|
||||
# update system
|
||||
RUN pacman -Syu --noconfirm && pacman-db-upgrade \
|
||||
&& pacman -S --noconfirm jdk-openjdk maven npm \
|
||||
&& pacman -S --noconfirm jdk-openjdk maven pnpm \
|
||||
&& pacman -Scc --noconfirm
|
||||
|
||||
ENV PATH /tmp/node_modules/.bin:$PATH
|
||||
WORKDIR /tmp
|
||||
ENV PATH /workspace/node_modules/.bin:$PATH
|
||||
WORKDIR /workspace
|
||||
|
||||
######################################################################################
|
||||
##
|
||||
@ -18,8 +18,8 @@ WORKDIR /tmp
|
||||
##
|
||||
######################################################################################
|
||||
FROM builder AS buildBack
|
||||
COPY back/pom.xml /tmp
|
||||
COPY back/src /tmp/src/
|
||||
COPY back/pom.xml back/Formatter.xml ./
|
||||
COPY back/src ./src/
|
||||
RUN mvn clean compile assembly:single
|
||||
|
||||
######################################################################################
|
||||
@ -29,21 +29,22 @@ RUN mvn clean compile assembly:single
|
||||
######################################################################################
|
||||
FROM builder AS buildFront
|
||||
|
||||
ADD front/package-lock.json \
|
||||
front/package.json \
|
||||
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 \
|
||||
/tmp/
|
||||
./
|
||||
|
||||
# install and cache app dependencies
|
||||
RUN npm install
|
||||
RUN pnpm install
|
||||
|
||||
ADD front/e2e \
|
||||
front/tsconfig.json \
|
||||
front/tslint.json \
|
||||
front/angular.json \
|
||||
/tmp/
|
||||
ADD front/src /tmp/src
|
||||
./
|
||||
ADD front/src ./src
|
||||
|
||||
# generate build
|
||||
RUN ng build --output-path=dist --configuration=production --base-href=/karso/ --deploy-url=/karso/ karso
|
||||
@ -60,11 +61,15 @@ 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/
|
||||
COPY --from=buildBack /workspace/out/maven/*.jar /application/application.jar
|
||||
COPY --from=buildFront /workspace/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
|
||||
|
||||
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karso.WebLauncher"]
|
||||
|
Loading…
Reference in New Issue
Block a user