commit
1bdf43d6e0
|
|
@ -52,4 +52,8 @@ unpackage/
|
|||
.vscode/
|
||||
|
||||
# [mac]
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
|
||||
docker/rocketmq/broker/logs/
|
||||
docker/rocketmq/broker/store/
|
||||
docker/rocketmq/namesrv/
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "jeepay-ui"]
|
||||
path = jeepay-ui
|
||||
url = https://gitee.com/jeequan/jeepay-ui.git
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
# syntax = docker/dockerfile:experimental
|
||||
# 使用了 Docker 特性 Buildx 请开启相关特性
|
||||
|
||||
# 切换 JDK 请修改后面的 17 到对应版本
|
||||
# docker build -t jeepay-deps:latest -f docs/Dockerfile .
|
||||
|
||||
# 编译依赖缓存,请先执行上方命令
|
||||
FROM jeepay-deps:latest AS builder
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
COPY . /workspace
|
||||
|
||||
RUN mvn clean package -Dmaven.test.skip=true -Ptest
|
||||
|
||||
|
||||
# 以下为运行容器 切换 JDK 请修改后面的 17 到对应版本
|
||||
FROM mcr.microsoft.com/java/jre:17-zulu-alpine
|
||||
|
||||
ARG PLATFORM=$PLATFORM
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
COPY --from=builder /workspace/jeepay-${PLATFORM}/target/jeepay-${PLATFORM}.jar /workspace/jeepay-app.jar
|
||||
COPY --from=builder /workspace/conf/${PLATFORM}/application.yml /workspace/application.yml
|
||||
|
||||
EXPOSE $PORT
|
||||
|
||||
CMD ["java", "-jar", "/workspace/jeepay-app.jar"]
|
||||
|
||||
# 编译命令
|
||||
# docker buildx build . --build-arg PORT=9216 --build-arg PLATFORM=payment -t jeepay-payment:latest
|
||||
# docker buildx build . --build-arg PORT=9217 --build-arg PLATFORM=manager -t jeepay-manager:latest
|
||||
# docker buildx build . --build-arg PORT=9218 --build-arg PLATFORM=merchant -t jeepay-merchant:latest
|
||||
#
|
||||
# 如果你需要多平台镜像,你可以使用 --platform linux/amd64,linux/arm64
|
||||
# 比如 docker buildx build . --build-arg PORT=9218 --build-arg PLATFORM=merchant -t jeepay-merchant:latest --platform linux/amd64,linux/arm64
|
||||
#
|
||||
# 启动命令
|
||||
# docker run -d -p 9216:9216 jeepay-payment:latest
|
||||
# docker run -d -p 9217:9217 jeepay-manager:latest
|
||||
# docker run -d -p 9218:9218 jeepay-merchant:latest
|
||||
|
|
@ -30,9 +30,9 @@ spring:
|
|||
number_format: '#' #数字格式进行原样显示,不加格式化字符例如 100,00
|
||||
datasource:
|
||||
# yml填写url连接串, 无需将&符号进行转义
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password:
|
||||
url: jdbc:mysql://172.20.0.10:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: jeepay
|
||||
password: jeepay
|
||||
druid:
|
||||
# 连接池配置项
|
||||
initial-size: 5 #初始化时建立物理连接的个数
|
||||
|
|
@ -55,7 +55,7 @@ spring:
|
|||
cache:
|
||||
type: redis
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
host: 172.20.0.12
|
||||
port: 6379
|
||||
database: 1 #1库:运营平台 #2库:商户系统 #3库:支付网关
|
||||
timeout: 1000
|
||||
|
|
@ -63,7 +63,7 @@ spring:
|
|||
|
||||
# #activeMQ配置 ( 注意: activeMQ配置项需在spring的下级 )
|
||||
activemq:
|
||||
broker-url: failover:(tcp://127.0.0.1:61616?wireFormat.maxInactivityDuration=0) #连接地址
|
||||
broker-url: failover:(tcp://172.20.0.11:61616?wireFormat.maxInactivityDuration=0) #连接地址
|
||||
in-memory: false # Jeepay项目不可使用内存模式, 需要连接多个消费者。
|
||||
user: system # activeMQ默认无需账密认证。 打开认证:activemq.xml添加simpleAuthenticationPlugin标签,账密在credentials.properties文件。
|
||||
password: manager
|
||||
|
|
@ -74,17 +74,18 @@ spring:
|
|||
#
|
||||
# #rabbitmq配置 ( 注意: rabbitmq配置项需在spring的下级 )
|
||||
# rabbitmq:
|
||||
# addresses: 127.0.0.1:5672
|
||||
# username: guest
|
||||
# password: guest
|
||||
# addresses: 172.20.0.11:5672
|
||||
# username: admin
|
||||
# password: admin
|
||||
# dynamic: true
|
||||
# virtual-host: /
|
||||
# virtual-host: jeepay
|
||||
|
||||
|
||||
## rocketmq配置 ( 注意:rocketmq配置项请放置到根目录, 不是spring的二级配置! )
|
||||
#rocketmq:
|
||||
# name-server: 127.0.0.1:9876
|
||||
# producer:
|
||||
# group: JEEPAY-GROUP
|
||||
rocketmq:
|
||||
name-server: 172.20.0.11:9876
|
||||
producer:
|
||||
group: JEEPAY-GROUP
|
||||
|
||||
## 阿里云rocketmq配置 ( 注意:aliyun-rocketmq配置项请放置到根目录, 不是spring的二级配置!需要阿里云开通rocketMQ产品,创建Group和Topic )
|
||||
#aliyun-rocketmq:
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ spring:
|
|||
number_format: '#' #数字格式进行原样显示,不加格式化字符例如 100,00
|
||||
datasource:
|
||||
# yml填写url连接串, 无需将&符号进行转义
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password:
|
||||
url: jdbc:mysql://172.20.0.10:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: jeepay
|
||||
password: jeepay
|
||||
druid:
|
||||
# 连接池配置项
|
||||
initial-size: 5 #初始化时建立物理连接的个数
|
||||
|
|
@ -55,7 +55,7 @@ spring:
|
|||
cache:
|
||||
type: redis
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
host: 172.20.0.12
|
||||
port: 6379
|
||||
database: 2 #1库:运营平台 #2库:商户系统 #3库:支付网关
|
||||
timeout: 1000
|
||||
|
|
@ -63,7 +63,7 @@ spring:
|
|||
|
||||
# #activeMQ配置 ( 注意: activeMQ配置项需在spring的下级 )
|
||||
activemq:
|
||||
broker-url: failover:(tcp://127.0.0.1:61616?wireFormat.maxInactivityDuration=0) #连接地址
|
||||
broker-url: failover:(tcp://172.20.0.11:61616?wireFormat.maxInactivityDuration=0) #连接地址
|
||||
in-memory: false # Jeepay项目不可使用内存模式, 需要连接多个消费者。
|
||||
user: system # activeMQ默认无需账密认证。 打开认证:activemq.xml添加simpleAuthenticationPlugin标签,账密在credentials.properties文件。
|
||||
password: manager
|
||||
|
|
@ -74,15 +74,16 @@ spring:
|
|||
#
|
||||
# #rabbitmq配置 ( 注意: rabbitmq配置项需在spring的下级 )
|
||||
# rabbitmq:
|
||||
# addresses: 127.0.0.1:5672
|
||||
# username: guest
|
||||
# password: guest
|
||||
# addresses: 172.20.0.11:5672
|
||||
# username: admin
|
||||
# password: admin
|
||||
# dynamic: true
|
||||
# virtual-host: /
|
||||
# virtual-host: jeepay
|
||||
|
||||
|
||||
## rocketmq配置 ( 注意:rocketmq配置项请放置到根目录, 不是spring的二级配置! )
|
||||
#rocketmq:
|
||||
# name-server: 127.0.0.1:9876
|
||||
# name-server: 172.20.0.11:9876
|
||||
# producer:
|
||||
# group: JEEPAY-GROUP
|
||||
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ spring:
|
|||
number_format: '#' #数字格式进行原样显示,不加格式化字符例如 100,00
|
||||
datasource:
|
||||
# yml填写url连接串, 无需将&符号进行转义
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password:
|
||||
url: jdbc:mysql://172.20.0.10:3306/jeepaydb?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: jeepay
|
||||
password: jeepay
|
||||
druid:
|
||||
# 连接池配置项
|
||||
initial-size: 5 #初始化时建立物理连接的个数
|
||||
|
|
@ -55,7 +55,7 @@ spring:
|
|||
cache:
|
||||
type: redis
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
host: 172.20.0.12
|
||||
port: 6379
|
||||
database: 3 #1库:运营平台 #2库:商户系统 #3库:支付网关
|
||||
timeout: 1000
|
||||
|
|
@ -63,7 +63,7 @@ spring:
|
|||
|
||||
# #activeMQ配置 ( 注意: activeMQ配置项需在spring的下级 )
|
||||
activemq:
|
||||
broker-url: failover:(tcp://127.0.0.1:61616?wireFormat.maxInactivityDuration=0) #连接地址
|
||||
broker-url: failover:(tcp://172.20.0.11:61616?wireFormat.maxInactivityDuration=0) #连接地址
|
||||
in-memory: false # Jeepay项目不可使用内存模式, 需要连接多个消费者。
|
||||
user: system # activeMQ默认无需账密认证。 打开认证:activemq.xml添加simpleAuthenticationPlugin标签,账密在credentials.properties文件。
|
||||
password: manager
|
||||
|
|
@ -74,17 +74,16 @@ spring:
|
|||
#
|
||||
# #rabbitmq配置 ( 注意: rabbitmq配置项需在spring的下级 )
|
||||
# rabbitmq:
|
||||
# addresses: 127.0.0.1:5672
|
||||
# username: guest
|
||||
# password: guest
|
||||
# addresses: 172.20.0.11:5672
|
||||
# username: admin
|
||||
# password: admin
|
||||
# dynamic: true
|
||||
# virtual-host: /
|
||||
# virtual-host: jeepay
|
||||
|
||||
## rocketmq配置 ( 注意:rocketmq配置项请放置到根目录, 不是spring的二级配置! )
|
||||
#rocketmq:
|
||||
# name-server: 127.0.0.1:9876
|
||||
# name-server: 172.20.0.11:9876
|
||||
# producer:
|
||||
# group: JEEPAY-GROUP
|
||||
|
||||
## 阿里云rocketmq配置 ( 注意:aliyun-rocketmq配置项请放置到根目录, 不是spring的二级配置!需要阿里云开通rocketMQ产品,创建Group和Topic )
|
||||
#aliyun-rocketmq:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,273 @@
|
|||
version: '3'
|
||||
|
||||
# Maven 依赖提前编译,修改 MQ 队列 (修改 jeepay-components-mq 依赖) 也需要重新运行此命令
|
||||
# docker build -t jeepay-deps:latest -f docs/Dockerfile .
|
||||
# 启动命令 docker-compose up
|
||||
# 启动并运行在后台 docker-compose up -d
|
||||
# 重新编译 docker-compose up --build
|
||||
# 重新创建 docker-composer up --force-recreate
|
||||
# 重新编译并覆盖之前的 docker-composer up --build --force-recreate
|
||||
|
||||
|
||||
# 编译前端请先执行 git submodule updata --init --recursive
|
||||
# 或者 git clone https://gitee.com/jeequan/jeepay-ui.git
|
||||
|
||||
services:
|
||||
mysql:
|
||||
hostname: mysql
|
||||
container_name: jeepay-mysql
|
||||
# amd64 平台
|
||||
image: mysql/mysql-server:latest
|
||||
#image: mysql:8
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: "rootroot"
|
||||
MYSQL_DATABASE: "jeepaydb"
|
||||
MYSQL_USER: "jeepay"
|
||||
MYSQL_PASSWORD: "jeepay"
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- mysql:/var/lib/mysql
|
||||
- ./docs/sql/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||
networks:
|
||||
jeepay:
|
||||
ipv4_address: 172.20.0.10
|
||||
activemq:
|
||||
build:
|
||||
context: ./docker/activemq
|
||||
dockerfile: Dockerfile
|
||||
hostname: activemq
|
||||
container_name: jeepay-activemq
|
||||
image: jeepay-activemq:latest
|
||||
ports: #- "1883:1883"
|
||||
#- "5672:5672"
|
||||
- "8161:8161"
|
||||
#- "61613:61613"
|
||||
#- "61614:61614"
|
||||
- "61616:61616"
|
||||
volumes:
|
||||
- activemq:/opt/activemq
|
||||
- ./docker/activemq/activemq.xml:/opt/activemq/conf/activemq.xml
|
||||
networks:
|
||||
jeepay:
|
||||
ipv4_address: 172.20.0.11
|
||||
# 扩展额外延迟插件的 RabbitMQ
|
||||
#rabbitmq:
|
||||
# build:
|
||||
# context: ./docker/rabbitmq
|
||||
# dockerfile: Dockerfile
|
||||
# hostname: rabbitmq
|
||||
# container_name: jeepay-rabbitmq
|
||||
# image: jeepay-rabbitmq:latest
|
||||
# ports:
|
||||
# - "15672:15672"
|
||||
# - "4369:4369"
|
||||
# - "5672:5672"
|
||||
# - "25672:25672"
|
||||
# environment:
|
||||
# RABBITMQ_DEFAULT_USER: 'admin'
|
||||
# RABBITMQ_DEFAULT_PASS: 'admin'
|
||||
# RABBITMQ_DEFAULT_VHOST: 'jeepay'
|
||||
# volumes:
|
||||
# - rabbitmq:/var/lib/rabbitmq
|
||||
# networks:
|
||||
# jeepay:
|
||||
# ipv4_address: 172.20.0.11
|
||||
# 使用 activemq 如有需要请修改 docker/activemq.xml 下相关配置
|
||||
#rocketmq-namesrv:
|
||||
# image: apache/rocketmq:4.9.3
|
||||
# container_name: rmqnamesrv
|
||||
# ports:
|
||||
# - 9876:9876
|
||||
# volumes:
|
||||
# - ./docker/rocketmq/namesrv/logs:/home/rocketmq/logs
|
||||
# command: sh mqnamesrv
|
||||
# networks:
|
||||
# jeepay:
|
||||
# ipv4_address: 172.20.0.11
|
||||
#rocketmq-broker:
|
||||
# image: apache/rocketmq:4.9.3
|
||||
# container_name: rmqbroker
|
||||
# ports:
|
||||
# - 10909:10909
|
||||
# - 10911:10911
|
||||
# - 10912:10912
|
||||
# environment:
|
||||
# - NAMESRV_ADDR=namesrv:9876
|
||||
# volumes:
|
||||
# - ./docker/rocketmq/broker/logs:/home/rocketmq/logs
|
||||
# - ./docker/rocketmq/broker/store:/home/rocketmq/store
|
||||
# - ./docker/rocketmq/broker/conf/broker.conf:/opt/rocketmq-4.9.3/conf/broker.conf
|
||||
# command: sh mqbroker -c /opt/rocketmq-4.9.3/conf/broker.conf
|
||||
# depends_on:
|
||||
# - rocketmq-namesrv
|
||||
# networks:
|
||||
# jeepay:
|
||||
# ipv4_address: 172.20.0.13
|
||||
redis:
|
||||
hostname: redis
|
||||
container_name: jeepay-redis
|
||||
image: redis:latest
|
||||
ports:
|
||||
- "6380:6379"
|
||||
networks:
|
||||
jeepay:
|
||||
ipv4_address: 172.20.0.12
|
||||
volumes:
|
||||
- redis:/data
|
||||
payment:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
PORT: 9216
|
||||
PLATFORM: payment
|
||||
image: jeepay-payment:latest
|
||||
hostname: payment
|
||||
container_name: jeepay-payment
|
||||
ports:
|
||||
- "9216:9216"
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
- activemq
|
||||
- rabbitmq
|
||||
- rocketmq-broker
|
||||
networks:
|
||||
jeepay:
|
||||
ipv4_address: 172.20.0.21
|
||||
volumes:
|
||||
- ./logs/payment:/workspace/logs
|
||||
- ./conf/payment/application.yml:/workspace/application.yml
|
||||
manager:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
PORT: 9217
|
||||
PLATFORM: manager
|
||||
image: jeepay-manager:latest
|
||||
hostname: manager
|
||||
container_name: jeepay-manager
|
||||
ports:
|
||||
- "9217:9217"
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
- activemq
|
||||
- rabbitmq
|
||||
- rocketmq-broker
|
||||
networks:
|
||||
jeepay:
|
||||
ipv4_address: 172.20.0.22
|
||||
volumes:
|
||||
- ./logs/manager:/workspace/logs
|
||||
- ./conf/manager/application.yml:/workspace/application.yml
|
||||
merchant:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
PORT: 9218
|
||||
PLATFORM: merchant
|
||||
image: jeepay-merchant:latest
|
||||
hostname: merchant
|
||||
container_name: jeepay-merchant
|
||||
ports:
|
||||
- "9218:9218"
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
- activemq
|
||||
- rabbitmq
|
||||
- rocketmq-broker
|
||||
networks:
|
||||
jeepay:
|
||||
ipv4_address: 172.20.0.23
|
||||
volumes:
|
||||
- ./logs/merchant:/workspace/logs
|
||||
- ./conf/merchant/application.yml:/workspace/application.yml
|
||||
ui-payment:
|
||||
build:
|
||||
context: ./jeepay-ui
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
PLATFORM: cashier
|
||||
image: jeepay-ui-payment:latest
|
||||
hostname: payment-ui
|
||||
container_name: jeepay-ui-payment
|
||||
environment:
|
||||
- BACKEND_HOST=172.20.0.21:9216
|
||||
ports:
|
||||
- "9226:80"
|
||||
depends_on:
|
||||
- payment
|
||||
networks:
|
||||
jeepay:
|
||||
ipv4_address: 172.20.0.31
|
||||
ui-manager:
|
||||
build:
|
||||
context: ./jeepay-ui
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
PLATFORM: manager
|
||||
image: jeepay-ui-manager:latest
|
||||
hostname: manager-ui
|
||||
container_name: jeepay-ui-manager
|
||||
environment:
|
||||
- BACKEND_HOST=172.20.0.22:9217
|
||||
ports:
|
||||
- "9227:80"
|
||||
depends_on:
|
||||
- manager
|
||||
networks:
|
||||
jeepay:
|
||||
ipv4_address: 172.20.0.32
|
||||
ui-merchant:
|
||||
build:
|
||||
context: ./jeepay-ui
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
PLATFORM: merchant
|
||||
image: jeepay-ui-merchant:latest
|
||||
hostname: merchant-ui
|
||||
container_name: jeepay-ui-merchant
|
||||
environment:
|
||||
- BACKEND_HOST=172.20.0.23:9218
|
||||
ports:
|
||||
- "9228:80"
|
||||
depends_on:
|
||||
- merchant
|
||||
networks:
|
||||
jeepay:
|
||||
ipv4_address: 172.20.0.33
|
||||
# 如果你需要对外完整配置,可以使用下面的方式
|
||||
# https://www.digitalocean.com/community/tools/nginx?domains.0.server.domain=pay.test.com&domains.0.server.documentRoot=&domains.0.server.redirectSubdomains=false&domains.0.https.hsts=false&domains.0.https.hstsPreload=true&domains.0.php.php=false&domains.0.reverseProxy.reverseProxy=true&domains.0.reverseProxy.proxyPass=http%3A%2F%2F172.20.0.26%3A9226&domains.0.routing.index=index.html&domains.0.routing.fallbackHtml=true&domains.0.routing.fallbackPhp=false&domains.0.logging.accessLog=true&domains.0.logging.errorLog=true&global.reverseProxy.proxyCoexistenceXForwarded=remove&global.app.lang=zhCN
|
||||
# 访问并配置好所有域名和代理,下载文件放到项目根目录下取名叫做 nginx.tar.gz
|
||||
#nginx:
|
||||
# image: nginx:latest
|
||||
# hostname: nginx
|
||||
# container_name: jeepay-nginx
|
||||
# ports:
|
||||
# - "80:80"
|
||||
# - "443:443"
|
||||
# depends_on:
|
||||
# - ui-manager
|
||||
# - ui-payment
|
||||
# - ui-merchant
|
||||
# volumes:
|
||||
# - ./nginx.tar.gz:/etc/nginx/nginx.tar.gz
|
||||
# # 需要给权限比如 chmod a+r ./conf/nginx.sh
|
||||
# - ./docker/nginx.sh:/docker-entrypoint.d/nginx.sh
|
||||
|
||||
networks:
|
||||
jeepay:
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.20.0.0/16
|
||||
|
||||
volumes:
|
||||
mysql:
|
||||
redis:
|
||||
activemq:
|
||||
# rabbitmq:
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
FROM bellsoft/liberica-openjdk-alpine:13
|
||||
|
||||
ENV ACTIVEMQ_VERSION 5.16.4
|
||||
ENV ACTIVEMQ apache-activemq-$ACTIVEMQ_VERSION
|
||||
ENV ACTIVEMQ_HOME /opt/activemq
|
||||
|
||||
RUN apk add --update curl && \
|
||||
rm -rf /var/cache/apk/* && \
|
||||
mkdir -p /opt && \
|
||||
curl -s -S https://archive.apache.org/dist/activemq/$ACTIVEMQ_VERSION/$ACTIVEMQ-bin.tar.gz | tar -xvz -C /opt && \
|
||||
ln -s /opt/$ACTIVEMQ $ACTIVEMQ_HOME && \
|
||||
addgroup -S activemq && \
|
||||
adduser -S -H -G activemq -h $ACTIVEMQ_HOME activemq && \
|
||||
chown -R activemq:activemq /opt/$ACTIVEMQ && \
|
||||
chown -h activemq:activemq $ACTIVEMQ_HOME
|
||||
|
||||
COPY ./activemq.xml $ACTIVEMQ_HOME/conf/activemq.xml
|
||||
|
||||
EXPOSE 1883 5672 8161 61613 61614 61616
|
||||
|
||||
USER activemq
|
||||
WORKDIR $ACTIVEMQ_HOME
|
||||
|
||||
CMD ["/bin/sh", "-c", "bin/activemq console"]
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- START SNIPPET: example -->
|
||||
<beans
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
||||
|
||||
<!-- Allows us to use system properties as variables in this configuration file -->
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="locations">
|
||||
<value>file:${activemq.conf}/credentials.properties</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Allows accessing the server log -->
|
||||
<bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"
|
||||
lazy-init="false" scope="singleton"
|
||||
init-method="start" destroy-method="stop">
|
||||
</bean>
|
||||
|
||||
<!--
|
||||
The <broker> element is used to configure the ActiveMQ broker.
|
||||
-->
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
|
||||
|
||||
<destinationPolicy>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<policyEntry topic=">">
|
||||
<!-- The constantPendingMessageLimitStrategy is used to prevent
|
||||
slow topic consumers to block producers and affect other consumers
|
||||
by limiting the number of messages that are retained
|
||||
For more information, see:
|
||||
|
||||
http://activemq.apache.org/slow-consumer-handling.html
|
||||
|
||||
-->
|
||||
<pendingMessageLimitStrategy>
|
||||
<constantPendingMessageLimitStrategy limit="1000"/>
|
||||
</pendingMessageLimitStrategy>
|
||||
</policyEntry>
|
||||
</policyEntries>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
||||
|
||||
<!--
|
||||
The managementContext is used to configure how ActiveMQ is exposed in
|
||||
JMX. By default, ActiveMQ uses the MBean server that is started by
|
||||
the JVM. For more information, see:
|
||||
|
||||
http://activemq.apache.org/jmx.html
|
||||
-->
|
||||
<managementContext>
|
||||
<managementContext createConnector="false"/>
|
||||
</managementContext>
|
||||
|
||||
<!--
|
||||
Configure message persistence for the broker. The default persistence
|
||||
mechanism is the KahaDB store (identified by the kahaDB tag).
|
||||
For more information, see:
|
||||
|
||||
http://activemq.apache.org/persistence.html
|
||||
-->
|
||||
<persistenceAdapter>
|
||||
<kahaDB directory="${activemq.data}/kahadb"/>
|
||||
</persistenceAdapter>
|
||||
|
||||
|
||||
<!--
|
||||
The systemUsage controls the maximum amount of space the broker will
|
||||
use before disabling caching and/or slowing down producers. For more information, see:
|
||||
http://activemq.apache.org/producer-flow-control.html
|
||||
-->
|
||||
<systemUsage>
|
||||
<systemUsage>
|
||||
<memoryUsage>
|
||||
<memoryUsage percentOfJvmHeap="70"/>
|
||||
</memoryUsage>
|
||||
<storeUsage>
|
||||
<storeUsage limit="100 gb"/>
|
||||
</storeUsage>
|
||||
<tempUsage>
|
||||
<tempUsage limit="50 gb"/>
|
||||
</tempUsage>
|
||||
</systemUsage>
|
||||
</systemUsage>
|
||||
|
||||
<!--
|
||||
The transport connectors expose ActiveMQ over a given protocol to
|
||||
clients and other brokers. For more information, see:
|
||||
|
||||
http://activemq.apache.org/configuring-transports.html
|
||||
-->
|
||||
<transportConnectors>
|
||||
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
|
||||
<transportConnector name="openwire"
|
||||
uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
|
||||
<transportConnector name="amqp"
|
||||
uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
|
||||
<transportConnector name="stomp"
|
||||
uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
|
||||
<transportConnector name="mqtt"
|
||||
uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
|
||||
<transportConnector name="ws"
|
||||
uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
|
||||
</transportConnectors>
|
||||
|
||||
<!-- destroy the spring context on shutdown to stop jetty -->
|
||||
<shutdownHooks>
|
||||
<bean xmlns="http://www.springframework.org/schema/beans"
|
||||
class="org.apache.activemq.hooks.SpringContextHook"/>
|
||||
</shutdownHooks>
|
||||
|
||||
|
||||
<!-- Add AuthenticationPlugin -->
|
||||
<plugins>
|
||||
<!-- 简单认证插件 -->
|
||||
<simpleAuthenticationPlugin>
|
||||
<users>
|
||||
<authenticationUser username="test" password="test" groups="users,admins"/>
|
||||
<authenticationUser username="system" password="manager" groups="users,admins"/>
|
||||
<authenticationUser username="user" password="password" groups="users"/>
|
||||
<authenticationUser username="guest" password="password" groups="guests"/>
|
||||
</users>
|
||||
</simpleAuthenticationPlugin>
|
||||
|
||||
<!-- JAAS认证插件
|
||||
<jaasAuthenticationPlugin configuration="activemq-domain" />
|
||||
-->
|
||||
</plugins>
|
||||
|
||||
</broker>
|
||||
|
||||
<!--
|
||||
Enable web consoles, REST and Ajax APIs and demos
|
||||
The web consoles requires by default login, you can disable this in the jetty.xml file
|
||||
|
||||
Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
|
||||
-->
|
||||
<import resource="jetty.xml"/>
|
||||
|
||||
</beans>
|
||||
<!-- END SNIPPET: example -->
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
/etc/nginx
|
||||
tar -czvf nginx_$(date +'%F_%H-%M-%S').tar.gz nginx.conf sites-available/ sites-enabled/ nginxconfig.io/
|
||||
tar -xzvf nginxconfig.io-pay.test.com.tar.gz | xargs chmod 0644
|
||||
|
||||
# SSL
|
||||
openssl dhparam -out /etc/nginx/dhparam.pem 2048
|
||||
mkdir -p /var/www/_letsencrypt
|
||||
chown www-data /var/www/_letsencrypt
|
||||
|
||||
# Certbot 复制页面上所有命令替换下方语句
|
||||
sed -i -r 's/(listen .*443)/\1; #/g; s/(ssl_(certificate|certificate_key|trusted_certificate) )/#;#\1/g; s/(server \{)/\1\n ssl off;/g' /etc/nginx/sites-available/pay.test.com.conf
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
certbot certonly --webroot -d pay.test.com --email info@pay.test.com -w /var/www/_letsencrypt -n --agree-tos --force-renewal
|
||||
sed -i -r -z 's/#?; ?#//g; s/(server \{)\n ssl off;/\1/g' /etc/nginx/sites-available/pay.test.com.conf
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
|
||||
# 结束
|
||||
|
||||
echo -e '#!/bin/bash\nnginx -t && systemctl reload nginx' | sudo tee /etc/letsencrypt/renewal-hooks/post/nginx-reload.sh
|
||||
sudo chmod a+x /etc/letsencrypt/renewal-hooks/post/nginx-reload.sh
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
FROM rabbitmq:3.9-management
|
||||
|
||||
RUN apt-get -o Acquire::Check-Date=false update && apt-get install -y curl
|
||||
|
||||
RUN curl -L https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/3.9.0/rabbitmq_delayed_message_exchange-3.9.0.ez > $RABBITMQ_HOME/plugins/rabbitmq_delayed_message_exchange-3.9.0.ez
|
||||
|
||||
RUN chown rabbitmq:rabbitmq $RABBITMQ_HOME/plugins/rabbitmq_delayed_message_exchange-3.9.0.ez
|
||||
|
||||
RUN rabbitmq-plugins enable rabbitmq_delayed_message_exchange
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
brokerClusterName = DefaultCluster
|
||||
brokerName = broker-a
|
||||
brokerId = 0
|
||||
deleteWhen = 04
|
||||
fileReservedTime = 48
|
||||
brokerRole = ASYNC_MASTER
|
||||
flushDiskType = ASYNC_FLUSH
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
FROM maven:3-eclipse-temurin-17
|
||||
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
RUN mvn dependency:go-offline
|
||||
|
|
@ -112,6 +112,12 @@
|
|||
<version>1.0.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jakarta.activation</groupId>
|
||||
<artifactId>jakarta.activation-api</artifactId>
|
||||
<version>1.2.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e20d7f8ddade37b465cb0d4091dcfb51890a7891
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.10</version>
|
||||
<version>1.18.22</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue