feat(datasync): add data synchronization service with PostgreSQL and DM support

- Configure PostgreSQL and DM datasources in application.yml
- Set up MyBatis-Plus for database operations
- Add server configuration for datasync service
- Define Docker Compose service for hsz-datasync
- Include environment variables and volume mapping
- Set entrypoint for datasync service startup
master
李一帆 2025-11-18 14:03:58 +08:00
parent db53639c2a
commit a3e87db7ce
2 changed files with 47 additions and 1 deletions

View File

@ -34,3 +34,16 @@ services:
depends_on: depends_on:
- hsz-redis - hsz-redis
entrypoint: java -cp "gunshi-project-hsz-1.0-SNAPSHOT.jar:./lib/*" com.gunshi.project.hsz.Main entrypoint: java -cp "gunshi-project-hsz-1.0-SNAPSHOT.jar:./lib/*" com.gunshi.project.hsz.Main
hsz-datasync:
container_name: hsz-datasync
image: openjdk:21
working_dir: /app
networks:
- tsg-bridge
volumes:
- /opt/hsz/java:/app
environment:
- SPRING_PROFILES_ACTIVE=prod
- TZ=Asia/Shanghai
entrypoint: java -cp "gunshi-project-hsz-datasync-1.0-SNAPSHOT.jar:./lib/*" com.gunshi.project.hsz.datasync.Main

View File

@ -0,0 +1,33 @@
server:
port: 24205
servlet:
context-path: /gunshiApp/hsz-datasync
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
update-strategy: always
spring:
profiles:
active: prod
datasource:
dynamic:
primary: master
datasource:
master:
url: jdbc:postgresql://postgres:5432/hsz?stringtype=unspecified
username: gunshiiot
password: 1234567a
driver-class-name: org.postgresql.Driver
jcsk: # 达梦数据源命名为jcsk
driver-class-name: dm.jdbc.driver.DmDriver
url: jdbc:dm://10.42.6.247:5236
username: SK_ZD001
password: Sk@123456
hikari:
maximum-pool-size: 20
minimum-idle: 5
connection-timeout: 30000