Skip to content

Commit

Permalink
Merge pull request #47 from ZhouYixun/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ZhouYixun authored Oct 15, 2021
2 parents 6716600 + 49de1d8 commit dcbd0af
Show file tree
Hide file tree
Showing 17 changed files with 386 additions and 102 deletions.
8 changes: 8 additions & 0 deletions config/actuator-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: health,info,refresh
18 changes: 18 additions & 0 deletions config/feign-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
feign:
hystrix:
enabled: true
client:
config:
default:
connectTimeout: 10000
readTimeout: 10000

hystrix:
command:
default:
execution:
timeout:
enabled: true
isolation:
thread:
timeoutInMilliseconds: 12000
11 changes: 11 additions & 0 deletions config/jdbc-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/sonic?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&autoReconnect=true&serverTimezone=GMT%2b8
username: root
password: Sonic!@#123
jpa:
open-in-view: true
hibernate:
ddl-auto: update
show-sql: true
8 changes: 8 additions & 0 deletions config/knife4j-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
knife4j:
enable: true
setting:
enableHost: true
enableHostText: "http://localhost:8094"
enableFooter: false
enableFooterCustom: true
footerCustomContent: MIT License | Copyright 2021 - [ZhouYiXun/sonic-server](https://github.com/ZhouYixun/sonic-server/blob/main/LICENSE)
7 changes: 7 additions & 0 deletions config/logging-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
logging:
file:
name: logs/${spring.application.name}.log
logback:
rollingpolicy:
clean-history-on-start: true
max-history: 3
7 changes: 7 additions & 0 deletions config/rabbitmq-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
spring:
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
virtual-host: sonic
5 changes: 5 additions & 0 deletions config/redis-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
spring:
redis:
database: 0
host: 127.0.0.1
port: 6379
11 changes: 11 additions & 0 deletions config/sonic-server-bus-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server:
port: 0

management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: health,info,bus-refresh
16 changes: 16 additions & 0 deletions config/sonic-server-controller-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server:
port: 0

spring:
data:
redis:
repositories:
enabled: false

robot:
client:
host: "http://localhost:3000"
img:
success: ""
warning: ""
error: ""
11 changes: 11 additions & 0 deletions config/sonic-server-folder-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server:
port: 0

spring:
servlet:
multipart:
maxFileSize: -1
maxRequestSize: -1

gateway:
host: "http://localhost:8094"
31 changes: 31 additions & 0 deletions config/sonic-server-gateway-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
server:
port: 8094

filter:
white-list: /users/login,/users/register,/swagger-resources,/v2/api-docs,/folder/upload,/folder/recordFiles,/keepFiles/,/imageFiles/,/recordFiles/,/logFiles/
resetToken: true

spring:
cloud:
gateway:
routes:
- id: controller
uri: lb://sonic-server-controller
predicates: Path=/api/controller/**
filters:
- StripPrefix=2
- id: folder
uri: lb://sonic-server-folder
predicates: Path=/api/folder/**
filters:
- StripPrefix=2
- id: task
uri: lb://sonic-server-task
predicates: Path=/api/task/**
filters:
- StripPrefix=2
- id: transport
uri: lb://sonic-server-transport
predicates: Path=/api/transport/**
filters:
- StripPrefix=2
27 changes: 27 additions & 0 deletions config/sonic-server-task-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
server:
port: 0

spring:
datasource:
initialization-mode: always
quartz:
properties:
org:
quartz:
scheduler:
instanceName: SonicQuartz
instanceId: AUTO
jobStore:
isClustered: true
job-store-type: jdbc
jdbc:
initialize-schema: never

sonic:
jobs:
fileCron: 0 0 12 * * ?
resultCron: 0 0 12 * * ?
dayReportCron: 0 0 10 * * ?
weekReportCron: 0 0 10 ? * Mon
filesKeepDay: 60
resultsKeepDay: 60
16 changes: 16 additions & 0 deletions config/sonic-server-transport-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server:
port: 0

spring:
rabbitmq:
listener:
simple:
acknowledge-mode: manual
retry:
enabled: true
max-attempts: 5
max-interval: 10000
initial-interval: 10000
default-requeue-rejected: true
publisher-confirm-type: correlated
publisher-returns: true
114 changes: 20 additions & 94 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,172 +1,98 @@
version: '3'
#you can add this for log debugging for every container.
#volumes:
# - /home/sonic/logs/:/logs/
services:
sonic-server-eureka:
image: "zhouyixun/sonic-server-eureka:v1.0.0"
hostname: sonic-server-eureka
environment:
- EUREKA_HOST=sonic-server-eureka
volumes:
- ./logs/:/logs/
networks:
- sonic-network
ports:
- "9090:9090"
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
update_config:
parallelism: 1
delay: 2s
restart_policy:
condition: on-failure
delay: 20s
max_attempts: 6
sonic-server-bus:
image: "zhouyixun/sonic-server-bus:v1.0.0"
image: "zhouyixun/sonic-server-bus:v1.0.1"
environment:
- PROFILE=prod
- CONFIG_TYPE=git
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
networks:
- sonic-network
volumes:
- ./config:/config
- ./logs/:/logs/
depends_on:
- sonic-server-eureka
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
update_config:
parallelism: 1
delay: 2s
restart_policy:
condition: on-failure
delay: 20s
max_attempts: 6
sonic-server-gateway:
image: "zhouyixun/sonic-server-gateway:v1.0.0"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
networks:
- sonic-network
volumes:
- ./logs/:/logs/
depends_on:
- sonic-server-bus
- sonic-server-eureka
ports:
- "8094:8094"
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
update_config:
parallelism: 1
delay: 2s
restart_policy:
condition: on-failure
delay: 20s
max_attempts: 6
sonic-server-controller:
image: "zhouyixun/sonic-server-controller:v1.0.0"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
networks:
- sonic-network
volumes:
- ./logs/:/logs/
depends_on:
- sonic-server-bus
- sonic-server-eureka
- sonic-server-gateway
deploy:
replicas: 2
placement:
constraints:
- node.role == worker
update_config:
parallelism: 1
delay: 2s
restart_policy:
condition: on-failure
delay: 20s
max_attempts: 6
sonic-server-folder:
image: "zhouyixun/sonic-server-folder:v1.0.0"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
networks:
- sonic-network
# volumes:
# - /home/sonic/keepFiles/:/keepFiles/
# - /home/sonic/imageFiles/:/imageFiles/
# - /home/sonic/recordFiles/:/recordFiles/
volumes:
- ./keepFiles/:/keepFiles/
- ./imageFiles/:/imageFiles/
- ./recordFiles/:/recordFiles/
- ./logs/:/logs/
depends_on:
- sonic-server-bus
- sonic-server-eureka
- sonic-server-gateway
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
update_config:
parallelism: 1
delay: 2s
restart_policy:
condition: on-failure
delay: 20s
max_attempts: 6
sonic-server-task:
image: "zhouyixun/sonic-server-task:v1.0.0"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
networks:
- sonic-network
volumes:
- ./logs/:/logs/
depends_on:
- sonic-server-bus
- sonic-server-eureka
- sonic-server-gateway
deploy:
replicas: 1
placement:
constraints:
- node.role == worker
update_config:
parallelism: 1
delay: 2s
restart_policy:
condition: on-failure
delay: 20s
max_attempts: 6
sonic-server-transport:
image: "zhouyixun/sonic-server-transport:v1.0.0"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
networks:
- sonic-network
volumes:
- ./logs/:/logs/
depends_on:
- sonic-server-bus
- sonic-server-eureka
- sonic-server-gateway
deploy:
replicas: 1
placement:
constraints:
- node.role == worker
update_config:
parallelism: 1
delay: 2s
restart_policy:
condition: on-failure
delay: 20s
max_attempts: 6

networks:
sonic-network:
driver: overlay
driver: bridge
Loading

0 comments on commit dcbd0af

Please sign in to comment.