Compare commits

...

2 Commits

Author SHA1 Message Date
root
3e88e757a8 Switch to Docker pipeline for Drone CI 2026-02-14 19:24:12 +01:00
root
e5ac5fa492 Add Dockerfile, Drone CI config, fix main class 2026-02-14 19:23:34 +01:00
4 changed files with 57 additions and 2 deletions

45
.drone.yml Normal file
View File

@@ -0,0 +1,45 @@
kind: pipeline
type: docker
name: build-and-deploy
steps:
- name: build-backend
image: maven:3.9-amazoncorretto-8
commands:
- cd jshERP-boot
- mvn package -DskipTests
volumes:
- name: maven-cache
path: /root/.m2
- name: build-frontend
image: node:18-alpine
commands:
- cd jshERP-web
- npm install --legacy-peer-deps
- npx vue-cli-service build
- name: docker-build-deploy
image: docker:dind
volumes:
- name: docker-sock
path: /var/run/docker.sock
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
volumes:
- name: maven-cache
host:
path: /root/.m2
- name: docker-sock
host:
path: /var/run/docker.sock
trigger:
branch:
- master
event:
- push

7
Dockerfile Normal file
View File

@@ -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"]

View File

@@ -141,6 +141,9 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.jsh.erp.ErpApplication</mainClass>
</configuration>
<version>2.0.3.RELEASE</version> <version>2.0.3.RELEASE</version>
<executions> <executions>
<execution> <execution>

View File

@@ -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.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.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=123456 spring.datasource.password=Qweewqzzx1
#mybatis-plus配置 #mybatis-plus配置
mybatis-plus.mapper-locations=classpath:./mapper_xml/*.xml mybatis-plus.mapper-locations=classpath:./mapper_xml/*.xml
# Redis # Redis
spring.redis.host=127.0.0.1 spring.redis.host=127.0.0.1
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=1234abcd spring.redis.password=
#租户对应的角色id #租户对应的角色id
manage.roleId=10 manage.roleId=10
#租户允许创建的用户数 #租户允许创建的用户数