From 44f453d566b1e11bc6dcace5bf0e709c2fbb4d48 Mon Sep 17 00:00:00 2001 From: zhao <70558837+fit2-zhao@users.noreply.github.com> Date: Thu, 5 Mar 2026 18:16:00 +0800 Subject: [PATCH] Revert: simplify Dockerfile and start script for application startup" This reverts commit d34c149e6aa6dec858a8d20c7192738ab72b9e15. --- installer/Dockerfile | 12 +++++++++--- installer/shells/start-cordys.sh | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/installer/Dockerfile b/installer/Dockerfile index 2a090e46b..afdd0925a 100644 --- a/installer/Dockerfile +++ b/installer/Dockerfile @@ -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 " 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"] \ No newline at end of file +ENTRYPOINT ["sh", "/shells/start-all.sh"] diff --git a/installer/shells/start-cordys.sh b/installer/shells/start-cordys.sh index 063996659..438cd92a6 100644 --- a/installer/shells/start-cordys.sh +++ b/installer/shells/start-cordys.sh @@ -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 \ No newline at end of file +sh /deployments/run-java.sh \ No newline at end of file