Skip to content

Commit 44f453d

Browse files
committed
Revert: simplify Dockerfile and start script for application startup"
This reverts commit d34c149.
1 parent 700aa4e commit 44f453d

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

installer/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,21 @@ COPY . /build
1313
COPY --from=frontend /frontend/packages/web/dist /build/frontend/packages/web/dist
1414
COPY --from=frontend /frontend/packages/mobile/dist /build/frontend/packages/mobile/dist
1515

16-
RUN ./mvnw clean package -DskipTests -pl '!frontend'
16+
RUN ./mvnw clean package -DskipTests -pl '!frontend' && \
17+
mkdir backend/app/target/dependency && \
18+
cd backend/app/target/dependency && \
19+
jar -xf ../*.jar
1720

1821
FROM ghcr.io/cordys-dev/cordys-base:latest
1922

2023
LABEL maintainer="FIT2CLOUD <support@fit2cloud.com>"
2124

2225
ARG MODULE=app
26+
ARG DEPENDENCY=/build/backend/${MODULE}/target/dependency
2327

24-
COPY --from=build /build/backend/${MODULE}/target/app-main.jar /app/cordys-crm.jar
28+
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
29+
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
30+
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
2531
COPY --from=build /build/backend/${MODULE}/src/main/resources/static /app/static
2632
COPY installer/shells /shells
2733
COPY installer/conf /installer/conf
@@ -44,4 +50,4 @@ VOLUME [ "/opt/cordys" ]
4450
EXPOSE 8081 8082 3306
4551

4652
RUN chmod 777 /shells/*.sh
47-
ENTRYPOINT ["sh", "/shells/start-all.sh"]
53+
ENTRYPOINT ["sh", "/shells/start-all.sh"]

installer/shells/start-cordys.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
bash /shells/init-directories.sh
44

5+
export JAVA_CLASSPATH=/app:/app/lib/*
6+
export JAVA_MAIN_CLASS=cn.cordys.Application
57
export CRM_VERSION=`cat /tmp/CRM_VERSION`
68

7-
exec java ${JAVA_OPTIONS} -jar /app/cordys-crm.jar
9+
sh /deployments/run-java.sh

0 commit comments

Comments
 (0)