From e5ac5fa492f61f20ae8daedc95697393fbe184d9 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 14 Feb 2026 19:23:34 +0100 Subject: [PATCH] Add Dockerfile, Drone CI config, fix main class --- .drone.yml | 28 +++++++++++++++++++ Dockerfile | 7 +++++ jshERP-boot/pom.xml | 3 ++ .../src/main/resources/application.properties | 4 +-- 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..9ca71496 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,28 @@ +kind: pipeline +type: exec +name: build-and-deploy + +platform: + os: linux + arch: amd64 + +steps: + - name: build-backend + commands: + - source /root/.sdkman/bin/sdkman-init.sh + - sdk use java 8.0.432-amzn + - cd jshERP-boot + - mvn package -DskipTests + + - name: build-frontend + commands: + - cd jshERP-web + - npm install --legacy-peer-deps + - npx vue-cli-service build + + - name: docker-build-deploy + commands: + - docker build -t jsherp:latest . + - docker stop jsherp || true + - docker rm jsherp || true + - docker run -d --name jsherp --network host -v /opt/jshERP/upload:/opt/jshERP/upload --restart unless-stopped jsherp:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..06278ec3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM amazoncorretto:8-alpine +WORKDIR /app +COPY jshERP-boot/target/jshERP.jar /app/jshERP.jar +COPY jshERP-web/dist /app/static +RUN mkdir -p /opt/jshERP/upload /opt/tmp/tomcat +EXPOSE 9999 +ENTRYPOINT ["java", "-jar", "/app/jshERP.jar"] diff --git a/jshERP-boot/pom.xml b/jshERP-boot/pom.xml index ff66b675..67a06287 100644 --- a/jshERP-boot/pom.xml +++ b/jshERP-boot/pom.xml @@ -141,6 +141,9 @@ org.springframework.boot spring-boot-maven-plugin + + com.jsh.erp.ErpApplication + 2.0.3.RELEASE diff --git a/jshERP-boot/src/main/resources/application.properties b/jshERP-boot/src/main/resources/application.properties index 633faca7..c9d92e08 100644 --- a/jshERP-boot/src/main/resources/application.properties +++ b/jshERP-boot/src/main/resources/application.properties @@ -7,13 +7,13 @@ server.servlet.context-path=/jshERP-boot spring.datasource.url=jdbc:mysql://127.0.0.1:3306/jsh_erp?useUnicode=true&characterEncoding=utf8&useCursorFetch=true&defaultFetchSize=500&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver spring.datasource.username=root -spring.datasource.password=123456 +spring.datasource.password=Qweewqzzx1 #mybatis-plus配置 mybatis-plus.mapper-locations=classpath:./mapper_xml/*.xml # Redis spring.redis.host=127.0.0.1 spring.redis.port=6379 -spring.redis.password=1234abcd +spring.redis.password= #租户对应的角色id manage.roleId=10 #租户允许创建的用户数