-
Notifications
You must be signed in to change notification settings - Fork 75
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 all 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,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 | ||
|
|
||
| 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 | ||
lu-yg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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=alpha"] | ||
| 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,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 | ||
| 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: alpha | ||
| #切面启用 | ||
| 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 | ||
|
|
||
Oops, something went wrong.
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.