diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..5f11a8b --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,4 @@ +FROM openjdk:8-jdk +ADD target/softbot.jar /data/softbot.jar +WORKDIR /data +ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS softbot.jar --spring.config.location=/data/config/softbot_application.yml"] \ No newline at end of file diff --git a/docker/config/softbot_application.yml b/docker/config/softbot_application.yml new file mode 100644 index 0000000..bcb1fc6 --- /dev/null +++ b/docker/config/softbot_application.yml @@ -0,0 +1,72 @@ +server: + port: 8080 +es-url: + 127.0.0.1:9200 +spring: + datasource: + username: root + password: 123456 #tonglin0711 + url: jdbc:mysql://localhost:3306/testforgeplus?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true + driver-class-name: com.mysql.cj.jdbc.Driver + dbcp2: + test-on-borrow: false + test-while-idle: true + time-between-eviction-runs-millis: 3600000 + + elasticsearch: + rest: + uris: http://127.0.0.1:9200 + devtools: + restart: + + enabled: true + + additional-paths: src/main/java + + poll-interval: 3000 + quiet-period: 1000 + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + mvc: + view: + prefix: /WEB-INF/jsp/ + suffix: .jsp + thymeleaf: + prefix: classpath:/templates/ + suffix: .html + encoding: UTF-8 + redis: + database: 0 + host: 101.35.140.79 + port: 6379 + # password: + # 连接超时时间 + timeout: 10000 + password: 123456 + +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + mapper-locations: classpath:mapper/*.xml + + +mybatis: + mapper-locations: classpath:mapper/*.xml + type-aliases-package: com.gitlink.softbot.entity + configuration: + map-underscore-to-camel-case: true + +#showSql +logging: + level: + com: + example: + mapper : debug +elasticsearch: + url: localhost:9200 + +gitlink: + url: https://testforgeplus.trustie.net + token: eyJraWQiOiJUaEVSLVl3Ukg4TWYwOHM0UnJLUDYzXzZLWmVET2NZckZXcmdzN2VUVWdrIiwiYWxnIjoiSFM1MTIifQ.eyJpc3MiOiJHaXRMaW5rIiwiaWF0IjoxNjc1NzYyMDkwLCJqdGkiOiI0MzA1ZDUwZC01ZGRkLTQ0MzUtODMyNS1iZDczYmVhMWMxYjciLCJ1c2VyIjp7ImlkIjpudWxsLCJsb2dpbiI6bnVsbCwibWFpbCI6bnVsbH19.hpHCJeU4Jyz-DM2NBUdB-tQW_E0-tu9H3LoGhsJ7kPHkSsdXJCII0jxhyPb9gwDsgd8SnlRZF8tZDDjnZSoztQ + diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..611f3dc --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,19 @@ +version: '3' +services: + gitlink-softbot: + container_name: softbot + image: softbot:1.0.0 + build: + context: ../ + dockerfile: docker/Dockerfile + volumes: + - ./config/softbot_application.yml:/data/config/softbot_application.yml + ports: + - "8069:8081" + environment: + - TZ=Asia/Shanghai + deploy: + resources: + limits: + memory: 800M + restart: always \ No newline at end of file diff --git a/docker/start_docker_compose.sh b/docker/start_docker_compose.sh new file mode 100644 index 0000000..bb69fb5 --- /dev/null +++ b/docker/start_docker_compose.sh @@ -0,0 +1 @@ +mvn -f ../pom.xml clean package -DskipTests && cp ../src/main/resources/application.yml ./config/softbot_application.yml && docker-compose -f docker-compose.yml up -d --build --force-recreate \ No newline at end of file diff --git a/pom.xml b/pom.xml index cd49a34..feb6132 100644 --- a/pom.xml +++ b/pom.xml @@ -158,7 +158,7 @@ - clothing-manage + softbot org.springframework.boot diff --git a/src/main/java/com/gitlink/softbot/config/CrossConfig.java b/src/main/java/com/gitlink/softbot/config/CrossConfig.java deleted file mode 100644 index a7de175..0000000 --- a/src/main/java/com/gitlink/softbot/config/CrossConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -//package com.gitlink.softbot.config; -// -//import org.springframework.context.annotation.Bean; -//import org.springframework.context.annotation.Configuration; -//import org.springframework.web.cors.CorsConfiguration; -//import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -//import org.springframework.web.filter.CorsFilter; -// -///** -// * ClassName CrossConfig -// * -// * @author ZengWei -// * Date 2021/7/15 -// */ -// -//@Configuration -//public class CrossConfig { -// private CorsConfiguration buildConfig() { -// CorsConfiguration corsConfiguration = new CorsConfiguration(); -// corsConfiguration.addAllowedOrigin("*"); -// corsConfiguration.addAllowedHeader("*"); -// corsConfiguration.addAllowedMethod("*"); -// corsConfiguration.setMaxAge(3600L); // 预检请求的有效期,单位为秒。 -// corsConfiguration.setAllowCredentials(true);// 是否支持安全证书(必需参数) -// return corsConfiguration; -// } -// -// @Bean -// public CorsFilter corsFilter() { -// UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); -// source.registerCorsConfiguration("/**", buildConfig()); -// return new CorsFilter(source); -// } -//}