Skip to content

Commit

Permalink
Merge pull request kkangert#21 from kkangert/add_config
Browse files Browse the repository at this point in the history
修改 用户配置参数
  • Loading branch information
kkangert authored Jul 31, 2024
2 parents 660c699 + 6e182b0 commit d07fdf2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
13 changes: 13 additions & 0 deletions deploy/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 数据库
DB_HOST=kspider-mysql
DB_ROOT_USERNAME=root
DB_ROOT_PASSWORD=123456
DB_PORT=3306

# selenium
SE_VNC_PASSWORD=123456
SE_NODE_MAX_SESSIONS=1

# kspider
KSPIDER_WEB_PORT=80
KSPIDER_BACKEND_PORT=8086
12 changes: 8 additions & 4 deletions deploy/kspider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
kspider-mysql:
image: mysql:8.0.38
environment:
MYSQL_ROOT_PASSWORD: 123456
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_ROOT_HOST: '%'
TZ: Asia/Shanghai
restart: always
Expand All @@ -20,7 +20,7 @@ services:
--lower_case_table_names=1
--max_allowed_packet=128M
ports:
- 3306:3306
- ${DB_PORT}:3306

# 如需使用selenium节点则开启下方配置
# https://github.com/SeleniumHQ/docker-selenium
Expand All @@ -46,11 +46,15 @@ services:
hostname: kspider
container_name: kspider
ports:
- 8086:8086
- ${KSPIDER_BACKEND_PORT}:8086
depends_on:
- kspider-mysql
environment:
envType: user
DB_HOST: ${DB_HOST}
DB_ROOT_USERNAME: ${DB_ROOT_USERNAME}
DB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
DB_PORT: ${DB_PORT}

# https://github.com/kkangert/kspider-ui
kspider-ui:
Expand All @@ -59,7 +63,7 @@ services:
hostname: kspider-ui
container_name: kspider-ui
ports:
- 80:80
- ${KSPIDER_WEB_PORT}:80
depends_on:
- kspider
- kspider-mysql
6 changes: 3 additions & 3 deletions kspider-web/src/main/resources/config/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ spring:
date-format: yyyy-MM-dd HH:mm:ss
# datasource
datasource:
url: jdbc:mysql://kspider-mysql:3306/kspider?createDatabaseIfNotExist=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&useSSL=true
username: root
password: 123456
url: jdbc:mysql://${MYSQL_ROOT_ADDRESS}:${MYSQL_PORT}/kspider?createDatabaseIfNotExist=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&useSSL=true
username: ${MYSQL_ROOT_USERNAME}
password: ${MYSQL_ROOT_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver
# jpa
jpa:
Expand Down

0 comments on commit d07fdf2

Please sign in to comment.