-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c6a46e
commit a1ec1bc
Showing
9 changed files
with
102 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
version: "2" | ||
services: | ||
redis: | ||
container_name: redis | ||
container_name: redis-for-mqttx | ||
image: redis | ||
mqttx: | ||
container_name: mqttx | ||
image: fantasywujun/mqttx | ||
image: fantasywujun/mqttx:1.2.0 | ||
ports: | ||
- 1883:1883 | ||
- 8083:8083 |
This file contains 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
FROM openjdk:8-jdk-alpine AS builder | ||
WORKDIR target/dependency | ||
ARG APPJAR=target/*.jar | ||
COPY ${APPJAR} app.jar | ||
FROM openjdk:17.0.1 | ||
WORKDIR /mqttx | ||
ARG EXECUTABLE_JAR=target/*.jar | ||
COPY ${EXECUTABLE_JAR} app.jar | ||
COPY target/classes/*.yml ./ | ||
COPY src/main/resources/logback-spring.xml ./ | ||
|
||
ENTRYPOINT ["java","-jar","-Xms1g","-Xmx1g","app.jar"] | ||
ENTRYPOINT ["java", "-jar", "app.jar", "--spring.config.location=/mqttx/"] |
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
spring: | ||
redis: | ||
host: localhost | ||
host: redis-for-mqttx | ||
|
||
mqttx: | ||
web-socket: | ||
|
This file contains 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 |
---|---|---|
@@ -1 +1,18 @@ | ||
# 生产环境配置文件 | ||
# 开发环境配置文件 | ||
|
||
spring: | ||
redis: | ||
host: redis-for-mqttx | ||
|
||
mqttx: | ||
web-socket: | ||
enable: true | ||
sys-topic: | ||
enable: true | ||
|
||
logging: | ||
level: | ||
root: info | ||
file: | ||
path: /mqttx/logs | ||
config: /mqttx/logback-spring.xml |
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
|_| |_| |_|\__, |\__|\__/_/\_\ | ||
| | | ||
|_| | ||
:: mqttx :: (v1.0.7.RELEASE) | ||
:: mqttx :: (1.2.0) |
This file contains 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,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration scan="true" scanPeriod="60 seconds" debug="false"> | ||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> | ||
<springProperty scope="context" name="springAppName" source="spring.application.name"/> | ||
<springProperty scope="context" name="logLevel" source="logging.level.root"/> | ||
<springProperty scope="context" name="logPath" source="logging.file.path"/> | ||
|
||
<property name="CONSOLE_LOG_PATTERN" | ||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} --- [%t] [%L] %clr(%-40.40logger{39}){cyan} : %m%n"/> | ||
<property name="FILE_LOG_PATTERN" | ||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } --- [%t] [%L] %-40.40logger{39} : %m%n"/> | ||
|
||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>${CONSOLE_LOG_PATTERN}</pattern> | ||
<charset>UTF-8</charset> | ||
</encoder> | ||
</appender> | ||
|
||
<root level="${logLevel}" additivity="false"> | ||
<appender-ref ref="CONSOLE"/> | ||
</root> | ||
|
||
<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>${logPath}/${springAppName}.log</file> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
<fileNamePattern>${logPath}/${springAppName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> | ||
<maxHistory>7</maxHistory> | ||
<maxFileSize>100MB</maxFileSize> | ||
<totalSizeCap>3GB</totalSizeCap> | ||
</rollingPolicy> | ||
<encoder> | ||
<pattern>${FILE_LOG_PATTERN}</pattern> | ||
<charset>UTF-8</charset> | ||
</encoder> | ||
</appender> | ||
|
||
<root level="${logLevel}" additivity="false"> | ||
<appender-ref ref="ROLLING"/> | ||
</root> | ||
</configuration> |