-
Notifications
You must be signed in to change notification settings - Fork 81
docs: add docker-compose for development env #4
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 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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,57 @@ | ||
| # Halo 前后端服务的 Docker Compose | ||
|
|
||
| 通过 Docker Compose 的方式启动 Halo 前后端服务快速查看插件效果。 | ||
|
|
||
| ## 开发指引 | ||
|
|
||
| ### 环境要求 | ||
|
|
||
| - OpenJDK 17 | ||
| - NodeJS 16+ | ||
| - pnpm 7+ | ||
| - docker | ||
| - docker-compose | ||
wan92hen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### 编译插件 | ||
|
|
||
| 下载前端依赖: | ||
|
|
||
| ```bash | ||
| cd ./plugin-template | ||
|
|
||
| ./gradlew.bat pnpmInstall | ||
|
|
||
| # or macOS/Linux | ||
|
|
||
| ./gradlew pnpmInstall | ||
| ``` | ||
|
|
||
| 构建: | ||
|
|
||
| ```bash | ||
| ./gradlew.bat build | ||
|
|
||
| # or macOS/Linux | ||
|
|
||
| ./gradlew build | ||
| ``` | ||
|
|
||
| ### 启动 Halo | ||
|
|
||
| ```bash | ||
| cd plugin-template/compose | ||
| docker-compose up -d | ||
| docker-compose ps | ||
| ``` | ||
|
|
||
| ### 访问后台 | ||
|
|
||
| 在浏览器中访问 https://localhost/admin 即可,登录用户名和密码为当前目录中 `application-dev.yaml` 配置中的 `super-admin-username` | ||
| 和 `super-admin-password`。 | ||
|
|
||
| 然后在左侧菜单中选择 `插件`,即可查看所有插件的状态。 | ||
|
|
||
| ### 开发 | ||
|
|
||
| 修改前端代码或者后端代码,然后运行 `./gradlew.bat build` 或者 `./gradlew build`(macOS/Linux)即可构建插件,无需重启 | ||
| Halo。但修改配置文件后需要 build 插件以及重启 Halo。 | ||
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 @@ | ||
| server: | ||
| port: 8090 | ||
| spring: | ||
| profiles: | ||
| active: dev | ||
| halo: | ||
| # external-url: https://next.ryanc.cc/ | ||
| security: | ||
| initializer: | ||
| super-admin-username: admin | ||
| super-admin-password: P@88w0rd | ||
| oauth2: | ||
| jwt: | ||
| jwsAlgorithm: rs512 | ||
| public-key-location: classpath:app.pub | ||
| private-key-location: classpath:app.key | ||
| plugin: | ||
| runtime-mode: development # development, deployment | ||
| classes-directories: | ||
| - "build/classes" | ||
| - "build/resources" | ||
| lib-directories: | ||
| - "libs" | ||
| fixedPluginPath: | ||
| - "/plugin" | ||
| springdoc: | ||
| api-docs: | ||
| enabled: true | ||
| swagger-ui: | ||
| enabled: true | ||
| show-login-endpoint: false | ||
| show-actuator: false | ||
| use-management-port: false | ||
| management: | ||
| endpoints: | ||
| web: | ||
| exposure: | ||
| include: health,info,metrics,startup,shutdown | ||
| server: | ||
| port: 8090 |
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,22 @@ | ||
| services: | ||
| halo: | ||
| image: halohub/halo-dev:next | ||
| ports: | ||
| - 8090:8090 | ||
| environment: | ||
| - SPRING_CONFIG_ADDITIONAL_LOCATION=optional:file:/etc/config/ | ||
| volumes: | ||
| - ./application.yaml:/etc/config/application.yaml | ||
| - ../:/plugin | ||
| networks: | ||
| - halo | ||
| halo-admin: | ||
| image: halohub/admin-dev:next | ||
| ports: | ||
| - 80:80 | ||
| volumes: | ||
| - ./halo.conf:/etc/nginx/conf.d/default.conf | ||
| networks: | ||
| - halo | ||
| networks: | ||
| halo: {} |
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,25 @@ | ||
| server { | ||
| listen 80; | ||
| listen [::]:80; | ||
| server_name localhost; | ||
|
|
||
| #access_log /var/log/nginx/host.access.log main; | ||
|
|
||
| location / { | ||
| proxy_pass http://halo:8090; | ||
| } | ||
|
|
||
| location /admin { | ||
| alias /usr/share/nginx/html; | ||
| index index.html index.htm; | ||
| } | ||
|
|
||
| #error_page 404 /404.html; | ||
|
|
||
| # redirect server error pages to the static page /50x.html | ||
| # | ||
| error_page 500 502 503 504 /50x.html; | ||
| location = /50x.html { | ||
| root /usr/share/nginx/html; | ||
| } | ||
| } |
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.