Revert: simplify Dockerfile and start script for application startup"

This reverts commit d34c149e6a.
This commit is contained in:
zhao
2026-03-05 18:16:00 +08:00
parent 700aa4e1ad
commit 44f453d566
2 changed files with 12 additions and 4 deletions

View File

@@ -13,15 +13,21 @@ COPY . /build
COPY --from=frontend /frontend/packages/web/dist /build/frontend/packages/web/dist
COPY --from=frontend /frontend/packages/mobile/dist /build/frontend/packages/mobile/dist
RUN ./mvnw clean package -DskipTests -pl '!frontend'
RUN ./mvnw clean package -DskipTests -pl '!frontend' && \
mkdir backend/app/target/dependency && \
cd backend/app/target/dependency && \
jar -xf ../*.jar
FROM ghcr.io/cordys-dev/cordys-base:latest
LABEL maintainer="FIT2CLOUD <support@fit2cloud.com>"
ARG MODULE=app
ARG DEPENDENCY=/build/backend/${MODULE}/target/dependency
COPY --from=build /build/backend/${MODULE}/target/app-main.jar /app/cordys-crm.jar
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
COPY --from=build /build/backend/${MODULE}/src/main/resources/static /app/static
COPY installer/shells /shells
COPY installer/conf /installer/conf
@@ -44,4 +50,4 @@ VOLUME [ "/opt/cordys" ]
EXPOSE 8081 8082 3306
RUN chmod 777 /shells/*.sh
ENTRYPOINT ["sh", "/shells/start-all.sh"]
ENTRYPOINT ["sh", "/shells/start-all.sh"]

View File

@@ -2,6 +2,8 @@
bash /shells/init-directories.sh
export JAVA_CLASSPATH=/app:/app/lib/*
export JAVA_MAIN_CLASS=cn.cordys.Application
export CRM_VERSION=`cat /tmp/CRM_VERSION`
exec java ${JAVA_OPTIONS} -jar /app/cordys-crm.jar
sh /deployments/run-java.sh