diff --git a/biji-houdaun/src/main/resources/application-dev.yml b/biji-houdaun/src/main/resources/application-dev.yml index 8529cab..982cfb9 100644 --- a/biji-houdaun/src/main/resources/application-dev.yml +++ b/biji-houdaun/src/main/resources/application-dev.yml @@ -14,8 +14,8 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://panel-jp.998521.xyz:37857/biji_db?useSSL=false&serverTimezone=UTC&characterEncoding=utf8 - username: root - password: Ll@12331100 + username: biji_user + password: Ll12331100 jpa: hibernate: ddl-auto: update diff --git a/biji-houdaun/src/main/resources/application-prod.yml b/biji-houdaun/src/main/resources/application-prod.yml index edb6555..8062945 100644 --- a/biji-houdaun/src/main/resources/application-prod.yml +++ b/biji-houdaun/src/main/resources/application-prod.yml @@ -1,5 +1,5 @@ spring: -# datasource: + datasource: # driver-class-name: org.sqlite.JDBC # url: jdbc:sqlite:/data/mydatabase.db # jpa: @@ -11,10 +11,35 @@ spring: # format_sql: false # dialect: org.hibernate.dialect.SQLiteDialect +# 上面是 默认配置,数据库为sqlite,下面是 配置mysql。从环境 变量中获取 + driver-class-name: ${DB_DRIVER:com.mysql.cj.jdbc.Driver} + url: ${DB_URL} + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + jpa: + hibernate: + ddl-auto: update + show-sql: true + properties: + hibernate: + format_sql: true + dialect: org.hibernate.dialect.MySQLDialect +# MyBatis-Plus配置 +mybatis-plus: + mapper-locations: classpath:mapper/*.xml + configuration: + map-underscore-to-camel-case: true + global-config: + db-config: + logic-delete-field: isDeleted # 全局逻辑删除的实体字段名 + logic-delete-value: 1 # 逻辑已删除值(默认为 1) + logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) + + # 禁用Knife4j knife4j: enable: false diff --git a/biji-houdaun/src/main/resources/application.yml b/biji-houdaun/src/main/resources/application.yml index 4539760..b520e8e 100644 --- a/biji-houdaun/src/main/resources/application.yml +++ b/biji-houdaun/src/main/resources/application.yml @@ -1,4 +1,11 @@ +server: + port: 8084 + forward-headers-strategy: framework + spring: + web: + nginx: + https-forward-headers: true application: name: biji-houdaun profiles: @@ -12,8 +19,6 @@ file: #?? -server: - port: 8084 ## Snowflake ID????? diff --git a/biji-qianduan/.env.web b/biji-qianduan/.env.web index 0edde97..615b37d 100644 --- a/biji-qianduan/.env.web +++ b/biji-qianduan/.env.web @@ -1,2 +1,3 @@ VITE_BASE_URL=/ -VITE_API_BASE_URL=https://biji-houduan.ikmkj.dpdns.org \ No newline at end of file +VITE_API_BASE_URL=https://biji-houduan2.ikmkj.dpdns.org/ + diff --git a/doc/编译打包等命令.md b/doc/编译打包等命令.md index 43348e7..a6dd184 100644 --- a/doc/编译打包等命令.md +++ b/doc/编译打包等命令.md @@ -37,6 +37,33 @@ top 查看型号 cat /proc/cpuinfo | grep "model name" | uniq -c + +# windows将本地镜像导入服务器中 +## windows上 +查看当前镜像 +docker images + + 导出镜像为tar文件 +docker save biji-houdaun:0.0.1-SNAPSHOT -o biji-houdaun.tar +## 在Linux服务器上导入镜像 +docker load -i biji-houdaun.tar + +验证镜像是否导入成功 +docker images + + +# MySQL数据库创建用户单独使用一个数据库 +-- 创建用户 +CREATE USER '用户名称'@'localhost'(本地)/'%'(所有主机) IDENTIFIED BY '密码'; + +-- 授予对biji_db数据库的权限 +GRANT ALL PRIVILEGES ON biji_db.* TO '用户名称'@'%'; + +-- 刷新权限 +FLUSH PRIVILEGES; + + + # docker启动命令 ## 运行命令 diff --git a/docker/.env b/docker/.env new file mode 100644 index 0000000..88eed80 --- /dev/null +++ b/docker/.env @@ -0,0 +1,3 @@ +DB_URL=jdbc:mysql://panel-jp.998521.xyz:37857/biji_db?useSSL=false&serverTimezone=UTC&characterEncoding=utf8 +DB_USERNAME=biji_user +DB_PASSWORD=Ll12331100 \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index b37ba45..a7bfd28 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -30,5 +30,13 @@ services: - "8084:8084" environment: TZ: "Asia/Shanghai" # 设置时区为上海时区 + # 从环境变量传入数据库配置 + SPRING_DATASOURCE_URL: ${DB_URL} + SPRING_DATASOURCE_USERNAME: ${DB_USERNAME} + SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD} + SPRING_PROFILES_ACTIVE: prod + env_file: + - .env # 从.env文件读取环境变量 + #上面的若是配置mysql,就用,下面的sqlite文件,不用sqlite可以不用写 volumes: - /docker/biji-houduan/data:/data