[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
|
FROM archlinux:base-devel AS builder
|
||||||
# update system
|
# update system
|
||||||
RUN pacman -Syu --noconfirm && pacman-db-upgrade \
|
RUN pacman -Syu --noconfirm && pacman-db-upgrade \
|
||||||
&& pacman -S --noconfirm jdk-openjdk maven npm \
|
&& pacman -S --noconfirm jdk-openjdk maven pnpm \
|
||||||
&& pacman -Scc --noconfirm
|
&& pacman -Scc --noconfirm
|
||||||
|
|
||||||
ENV PATH /tmp/node_modules/.bin:$PATH
|
ENV PATH /workspace/node_modules/.bin:$PATH
|
||||||
WORKDIR /tmp
|
WORKDIR /workspace
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
##
|
##
|
||||||
@ -18,8 +18,8 @@ WORKDIR /tmp
|
|||||||
##
|
##
|
||||||
######################################################################################
|
######################################################################################
|
||||||
FROM builder AS buildBack
|
FROM builder AS buildBack
|
||||||
COPY back/pom.xml /tmp
|
COPY back/pom.xml back/Formatter.xml ./
|
||||||
COPY back/src /tmp/src/
|
COPY back/src ./src/
|
||||||
RUN mvn clean compile assembly:single
|
RUN mvn clean compile assembly:single
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
@ -29,21 +29,22 @@ RUN mvn clean compile assembly:single
|
|||||||
######################################################################################
|
######################################################################################
|
||||||
FROM builder AS buildFront
|
FROM builder AS buildFront
|
||||||
|
|
||||||
ADD front/package-lock.json \
|
RUN echo "@kangaroo-and-rabbit:registry=https://gitea.atria-soft.org/api/packages/kangaroo-and-rabbit/npm/" > /root/.npmrc
|
||||||
front/package.json \
|
|
||||||
|
ADD front/package.json \
|
||||||
front/karma.conf.js \
|
front/karma.conf.js \
|
||||||
front/protractor.conf.js \
|
front/protractor.conf.js \
|
||||||
/tmp/
|
./
|
||||||
|
|
||||||
# install and cache app dependencies
|
# install and cache app dependencies
|
||||||
RUN npm install
|
RUN pnpm install
|
||||||
|
|
||||||
ADD front/e2e \
|
ADD front/e2e \
|
||||||
front/tsconfig.json \
|
front/tsconfig.json \
|
||||||
front/tslint.json \
|
front/tslint.json \
|
||||||
front/angular.json \
|
front/angular.json \
|
||||||
/tmp/
|
./
|
||||||
ADD front/src /tmp/src
|
ADD front/src ./src
|
||||||
|
|
||||||
# generate build
|
# generate build
|
||||||
RUN ng build --output-path=dist --configuration=production --base-href=/karso/ --deploy-url=/karso/ karso
|
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
|
ENV LANG=C.UTF-8
|
||||||
|
|
||||||
COPY --from=buildBack /tmp/out/maven/*.jar /application/application.jar
|
COPY --from=buildBack /workspace/out/maven/*.jar /application/application.jar
|
||||||
COPY --from=buildFront /tmp/dist /application/front/
|
COPY --from=buildFront /workspace/dist /application/front/
|
||||||
|
|
||||||
WORKDIR /application/
|
WORKDIR /application/
|
||||||
|
|
||||||
EXPOSE 80
|
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"]
|
CMD ["java", "-Xms64M", "-Xmx1G", "-cp", "/application/application.jar", "org.kar.karso.WebLauncher"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user