fix dockerfile

This commit is contained in:
bwcx_jzy 2022-11-17 21:56:15 +08:00
parent 312f398c38
commit 035430fb2d
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
2 changed files with 20 additions and 6 deletions

View File

@ -27,6 +27,8 @@ FROM maven:3.8.5-jdk-8-slim as builder
WORKDIR /target/dependency
COPY . .
ENV NODE_VERSION 16.13.1
RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
@ -41,15 +43,22 @@ RUN set -eux; \
exit 1; \
;; \
esac; \
curl -LfsSo /opt/node-v16.13.1-linux-${BINARY_ARCH}.tar.gz https://npmmirror.com/mirrors/node/v16.13.1/node-v16.13.1-linux-${BINARY_ARCH}.tar.gz \
&& tar -zxvf /opt/node-v16.13.1-linux-${BINARY_ARCH}.tar.gz -C /opt/ \
&& export PATH=/opt/node-v16.13.1-linux-${BINARY_ARCH}/bin:$PATH \
&& npm config set registry https://registry.npmmirror.com/ \
&& cd web-vue && npm install && npm run build
curl -LfsSo /opt/node-v${NODE_VERSION}-linux-${BINARY_ARCH}.tar.gz https://npmmirror.com/mirrors/node/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${BINARY_ARCH}.tar.gz \
&& tar -zxvf /opt/node-v${NODE_VERSION}-linux-${BINARY_ARCH}.tar.gz -C /usr/local --strip-components=1 \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& npm config set registry https://registry.npmmirror.com/
RUN cd web-vue && npm install && npm run build
RUN mvn -B -e -T 1C clean package -pl modules/server -am -Dmaven.test.skip=true -Dmaven.compile.fork=true -s script/settings.xml
FROM maven:3.8.5-jdk-8
ARG BUILD_DATE
LABEL build_info="dromara/Jpom build-date:- ${BUILD_DATE}"
LABEL maintainer="bwcx-jzy <bwcx_jzy@163.com>"
LABEL documentation="https://jpom.top"
ENV JPOM_HOME /usr/local/jpom-server
ARG JPOM_VERSION
ENV JPOM_PKG server-${JPOM_VERSION}-release
@ -68,9 +77,9 @@ ENV jpom.path ${JPOM_DATA_PATH}
VOLUME $JPOM_DATA_PATH $JPOM_LOG_PATH
HEALTHCHECK CMD curl -X POST -f http://localhost:2122/check-system || exit 1
EXPOSE 2122
HEALTHCHECK CMD curl -X POST -f http://localhost:2122/check-system || exit 1
ENTRYPOINT ["/bin/bash", "Server.sh", "start"]

View File

@ -23,6 +23,11 @@
FROM maven:3.8.5-jdk-8
ARG BUILD_DATE
LABEL build_info="dromara/Jpom build-date:- ${BUILD_DATE}"
LABEL maintainer="bwcx-jzy <bwcx_jzy@163.com>"
LABEL documentation="https://jpom.top"
ENV JPOM_HOME /usr/local/jpom-server
ENV JPOM_PKG_VERSION 2.9.15
ENV JPOM_PKG server-${JPOM_PKG_VERSION}-release.tar.gz