-
Notifications
You must be signed in to change notification settings - Fork 83
feat: add docker deploy #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
262db02
feat: add docker-compose file
lu-yg a6bab59
feat: add maven settings.xml
lu-yg 5ed6d4e
feat: add docker deploy
lu-yg 7253d72
feat: add dockerfile
lu-yg 8adea2a
add docker deploy
lu-yg 3d418bf
add docker deploy
lu-yg 987512d
feat: add docker deploy
lu-yg a9ad907
fix: fix application-alpha.yml
lu-yg 899816f
fix: Fix nginx.conf
lu-yg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| server: | ||
| port: 9090 | ||
|
|
||
| spring: | ||
| servlet: | ||
| multipart: | ||
| max-file-size: 10MB | ||
| max-request-size: 10MB | ||
| jackson: | ||
| date-format: yyyy-MM-dd HH:mm:ss | ||
| datasource: | ||
| driver-class-name: org.mariadb.jdbc.Driver | ||
| username: root | ||
| password: 111111 | ||
| url: jdbc:mariadb://tiny-engine-data:3306/tiny_engine_data_java?useUnicode=true&useSSL=false&characterEncoding=utf8 | ||
lu-yg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type: com.alibaba.druid.pool.DruidDataSource | ||
| druid: | ||
| initial-size: 5 # 连接池初始化时建立的连接数,默认值为 0。 | ||
| min-idle: 5 # 连接池中最小的空闲连接数,默认值为 0。 | ||
| max-active: 20 # 连接池中最大活动连接数(即同时可以被请求的连接数),默认值为 8。 | ||
| test-on-borrow: true # 在从连接池获取连接时,是否进行有效性检查,默认值为 false。 | ||
| validation-query: SELECT 1 # 用于检测连接是否有效的 SQL 查询语句,通常为简单的查询,比如 `SELECT 1`。如果连接不可用,会被关闭并重新建立。 | ||
| max-wait: 60000 # 获取连接的最大等待时间(单位:毫秒),超时会抛出异常,默认值为 30000。 | ||
| time-between-eviction-runs-millis: 60000 # 空闲连接检测线程运行的时间间隔(单位:毫秒)。空闲连接检测线程会定期检查空闲连接,默认值为 30000。 | ||
| min-evictable-idle-time-millis: 300000 # 连接在池中保持空闲的最小时间(单位:毫秒)。如果空闲时间超过这个值,连接将被回收,默认值为 1800000。 | ||
| pool-prepared-statements: true # 是否缓存 PreparedStatement 对象,默认值为 true。 | ||
| max-open-prepared-statements: 20 # 最大缓存的 PreparedStatement 数量,默认值为 -1,表示无限制。如果 `pool-prepared-statements` 设置为 true,设置此值以限制缓存数量。 | ||
| config: | ||
| activate: | ||
| on-profile: dev | ||
| #切面启用 | ||
| aop: | ||
| proxy-target-class: true #默认为false | ||
| auto: true #默认为false | ||
| springdoc: | ||
| api-docs: | ||
| #是否开启文档功能 | ||
| enabled: true | ||
| #swagger后端请求地址 | ||
| path: /api-docs | ||
| swagger-ui: | ||
| enabled: false | ||
| path: /swagger-ui.html #自定义swagger-ui HTML文档路径 | ||
| #包扫描路径 | ||
| packages-to-scan: com.tinyengine.it.controller | ||
|
|
||
| mybatis-plus: | ||
| mapper-locations: classpath:mappers/*.xml | ||
| configuration: | ||
| log-impl: org.apache.ibatis.logging.stdout.StdOutImpl | ||
| map-underscore-to-camel-case: true | ||
| auto-mapping-behavior: full | ||
| com.tinyengine.it.mapper: debug | ||
| type-handlers-package: com.tinyengine.it.common.handler | ||
|
|
||
|
|
||
| logging: | ||
| level: | ||
| ROOT: INFO | ||
| druid.sql.Statement: INFO | ||
| pattern: | ||
| file: "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" | ||
| file: | ||
| name: /logs | ||
|
|
||
| cors: | ||
| allowed-origins: "*" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| version: '3' | ||
| services: | ||
| tiny-engine-data: | ||
| image: mysql:5.7 | ||
| container_name: tiny-engine-data | ||
| ports: | ||
| - "3306:3306" | ||
| environment: | ||
| MYSQL_ROOT_PASSWORD: 111111 | ||
| MYSQL_DATABASE: tiny_engine_data_java | ||
lu-yg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| TZ: Asia/Shanghai | ||
| volumes: | ||
| - ./docker-deploy-data/mysql/data/:/var/lib/mysql/ | ||
| - ./docker-deploy-data/mysql/conf/:/etc/mysql/conf.d/ | ||
| - ./docker-deploy-data/mysql/init/:/docker-entrypoint-initdb.d/ | ||
| - ./docker-deploy-data/mysql/logs/:/logs/ | ||
|
|
||
| tiny-engine-back: | ||
| image: tiny-engine-back | ||
| container_name: tiny-engine-back | ||
| build: | ||
| context: . | ||
| dockerfile: dockerfile | ||
| ports: | ||
| - "9090:9090" | ||
| depends_on: | ||
| - tiny-engine-data | ||
|
|
||
| tiny-engine: | ||
| image: tiny-engine | ||
| container_name: tiny-engine | ||
| build: | ||
| context: ../tiny-engine/ | ||
| dockerfile: dockerfile | ||
| ports: | ||
| - "80:80" | ||
| volumes: | ||
| - ./docker-deploy-data/nginx.conf:/etc/nginx/nginx.conf | ||
| depends_on: | ||
| - tiny-engine-back | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [client] | ||
| default-character-set=utf8mb4 | ||
| [mysql] | ||
| default-character-set=utf8mb4 | ||
| [mysqld] | ||
| init-connect="SET collation_connection = utf8mb4_unicode_ci" | ||
| init-connect="SET NAMES utf8mb4" | ||
lu-yg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| collation-server=utf8mb4_unicode_ci | ||
| character-set-server=utf8mb4 | ||
|
|
||
679 changes: 679 additions & 0 deletions
679
docker-deploy-data/mysql/init/create_all_tables_ddl_v1.0.0.mysql.sql
Large diffs are not rendered by default.
Oops, something went wrong.
175 changes: 175 additions & 0 deletions
175
docker-deploy-data/mysql/init/init_data_for_test_v1.0.0.sql
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| ALTER TABLE t_component DROP INDEX u_idx_component; | ||
| ALTER TABLE t_component ADD INDEX u_idx_component (tenant_id, name_en, version, library_id); | ||
|
|
||
| ALTER TABLE t_datasource DROP INDEX u_idx_datasource; | ||
| ALTER TABLE t_datasource ADD INDEX u_idx_datasource (`tenant_id`, `platform_id`, `name`, `app_id`); | ||
|
|
||
| ALTER TABLE t_platform_history MODIFY sub_count int NULL; | ||
| ALTER TABLE t_platform_history MODIFY publish_url varchar(255) NULL; | ||
|
|
||
| ALTER TABLE t_app MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_app_extension MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_block MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_block_carriers_relation MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_block_group MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_block_history MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_business_category MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_component MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_component_library MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_datasource MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_i18n_entry MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_material MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_material_history MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_page MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_page_history MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_page_template MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_platform MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_platform_history MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_task_record MODIFY tenant_id varchar(60) NULL; | ||
| ALTER TABLE t_user MODIFY tenant_id varchar(60) NULL; | ||
|
|
2 changes: 2 additions & 0 deletions
2
docker-deploy-data/mysql/init/update_tables_ddl_v1.0.0_2025_0527.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALTER TABLE t_block_group DROP INDEX u_idx_block_group; | ||
| ALTER TABLE t_block_group ADD INDEX u_idx_block_group (`tenant_id`, `platform_id`, `name`, `app_id`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
|
|
||
| events { | ||
| worker_connections 1024; | ||
| } | ||
|
|
||
|
|
||
| http { | ||
| include mime.types; | ||
| default_type application/octet-stream; | ||
| sendfile on; | ||
| keepalive_timeout 65; | ||
| server { | ||
| listen 80; | ||
| server_name 0.0.0.0;# public ip or domain name | ||
| location / { | ||
| root /usr/share/nginx/html; | ||
| index index.html index.htm; | ||
| } | ||
| location ~* ^/(.*-center)/(.*) { | ||
| proxy_pass http://tiny-engine-back:9090/$1/$2; | ||
| proxy_set_header Host $host; | ||
lu-yg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| } | ||
| error_page 500 502 503 504 /50x.html; | ||
| location = /50x.html { | ||
| root html; } | ||
| } | ||
|
|
||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| FROM eclipse-temurin:17-jdk-jammy as build | ||
| WORKDIR /app | ||
| ADD . . | ||
| RUN wget --no-check-certificate https://mirrors.huaweicloud.com/apache/maven/maven-3/3.9.8/binaries/apache-maven-3.9.8-bin.tar.gz | ||
lu-yg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| RUN tar -zxvf apache-maven-3.9.8-bin.tar.gz | ||
|
|
||
| RUN rm apache-maven-3.9.8-bin.tar.gz | ||
| ENV M2_HOME=/app/apache-maven-3.9.8 | ||
| ENV PATH=$M2_HOME/bin:$PATH | ||
| COPY settings.xml /app/apache-maven-3.9.8/conf/settings.xml | ||
| RUN mvn clean package -Dmaven.test.skip=true | ||
| FROM eclipse-temurin:17-jdk-jammy | ||
| WORKDIR /app | ||
| COPY --from=build /app/app/target/tiny-engine-app-*.jar /app/tiny-engine-app.jar | ||
| COPY --from=build /app/base/target/tiny-engine-base-*.jar /app/tiny-engine-base.jar | ||
|
|
||
| ENTRYPOINT ["java", "-jar", "tiny-engine-app.jar", "--spring.profiles.active=dev"] | ||
lu-yg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| EXPOSE 9090 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd"> | ||
|
|
||
| <pluginGroups> | ||
|
|
||
| </pluginGroups> | ||
|
|
||
|
|
||
| <proxies> | ||
|
|
||
| </proxies> | ||
|
|
||
| <servers> | ||
| <server> | ||
| <id>deploymentRepo</id> | ||
| <username>repouser</username> | ||
| <password>repopwd</password> | ||
| </server> | ||
| </servers> | ||
lu-yg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <!--<mirrors>标签中可以包含多个<mirror>标签,每个<mirror>用于设置一个镜像仓库--> | ||
| <mirrors> | ||
| <!-- 这里设置的是阿里公共代理仓库 --> | ||
| <mirror> | ||
| <!-- 镜像的唯一标识符,用来区分不同的镜像 --> | ||
| <id>aliyunmaven</id> | ||
| <!-- 镜像名称 --> | ||
| <name>阿里云公共仓库</name> | ||
| <!-- 镜像的URL地址 --> | ||
| <url>https://maven.aliyun.com/repository/public</url> | ||
|
|
||
| <mirrorOf>*</mirrorOf> | ||
| </mirror> | ||
| </mirrors> | ||
|
|
||
| <profiles> | ||
|
|
||
| </profiles> | ||
|
|
||
| </settings> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.