mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
更新docker-compose配置文件
This commit is contained in:
101
docker/data/docker-compose.yml
Normal file
101
docker/data/docker-compose.yml
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
redis:
|
||||||
|
image: redis:7.0.0
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
privileged: true
|
||||||
|
networks:
|
||||||
|
- wumei-network
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /var/data/redis:/usr/local/etc/redis
|
||||||
|
- /var/data/redis/data:/data
|
||||||
|
command: [ '-- requirepass wumei-smart', '-- appendonly yes' ]
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
privileged: true
|
||||||
|
networks:
|
||||||
|
- wumei-network
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /var/data/mysql/mysql:/var/lib/mysql
|
||||||
|
- /var/data/mysql/mysql.cnf:/etc/mysql/conf.d/mysql.cnf
|
||||||
|
- /var/data/mysql/initdb:/docker-entrypoint-initdb.d
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: wumeismart
|
||||||
|
MYSQL_ROOT_PASSWORD: wumei-smart
|
||||||
|
command:
|
||||||
|
[
|
||||||
|
'mysqld',
|
||||||
|
'--character-set-server=utf8',
|
||||||
|
'--collation-server=utf8_unicode_ci',
|
||||||
|
'--default-time-zone=+8:00',
|
||||||
|
'--lower-case-table-names=1'
|
||||||
|
]
|
||||||
|
|
||||||
|
emqx:
|
||||||
|
image: emqx/emqx:v4.0.0
|
||||||
|
ports:
|
||||||
|
- 1883:1883
|
||||||
|
- 8081:8081
|
||||||
|
- 8083:8083
|
||||||
|
- 8883:8883
|
||||||
|
- 8084:8084
|
||||||
|
- 18083:18083
|
||||||
|
privileged: true
|
||||||
|
networks:
|
||||||
|
- wumei-network
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /etc/timezone:/etc/timezone
|
||||||
|
- /etc/localtime:/etc/localtime
|
||||||
|
- /var/data/emqx/conf/emqx_auth_http.conf:/opt/emqx/etc/plugins/emqx_auth_http.conf
|
||||||
|
- /var/data/emqx/conf/emqx_web_hook.conf:/opt/emqx/etc/plugins/emqx_web_hook.conf
|
||||||
|
environment:
|
||||||
|
EMQX_ALLOW__ANONYMOUS: "false"
|
||||||
|
|
||||||
|
java:
|
||||||
|
image: openjdk:8u265-jre-buster
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
privileged: true
|
||||||
|
networks:
|
||||||
|
- wumei-network
|
||||||
|
depends_on:
|
||||||
|
- emqx
|
||||||
|
- redis
|
||||||
|
- mysql
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /var/data/java/server.jar:/server.jar
|
||||||
|
- /var/data/java/uploadPath:/uploadPath
|
||||||
|
- /var/data/java/logs:/logs
|
||||||
|
- /etc/timezone:/etc/timezone
|
||||||
|
- /etc/localtime:/etc/localtime
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
entrypoint: java -jar /server.jar
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
image: nginx:stable
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
privileged: true
|
||||||
|
networks:
|
||||||
|
- wumei-network
|
||||||
|
depends_on:
|
||||||
|
- java
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /var/data/nginx/html:/usr/share/nginx/html
|
||||||
|
- /var/data/nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
networks:
|
||||||
|
wumei-network:
|
||||||
|
name: wumei-network
|
||||||
|
driver: bridge
|
||||||
133
docker/data/emqx/conf/emqx_auth_http.conf
Normal file
133
docker/data/emqx/conf/emqx_auth_http.conf
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
##--------------------------------------------------------------------
|
||||||
|
## HTTP Auth/ACL Plugin
|
||||||
|
##--------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
##------------------------------------------------------------------------------
|
||||||
|
## SSL options
|
||||||
|
|
||||||
|
## Path to the file containing PEM-encoded CA certificates. The CA certificates
|
||||||
|
## are used during server authentication and when building the client certificate chain.
|
||||||
|
##
|
||||||
|
## Value: File
|
||||||
|
## auth.http.ssl.cacertfile = /etc/emqx/certs/ca.pem
|
||||||
|
|
||||||
|
## The path to a file containing the client's certificate.
|
||||||
|
##
|
||||||
|
## Value: File
|
||||||
|
## auth.http.ssl.certfile = /etc/emqx/certs/client-cert.pem
|
||||||
|
|
||||||
|
## Path to a file containing the client's private PEM-encoded key.
|
||||||
|
##
|
||||||
|
## Value: File
|
||||||
|
## auth.http.ssl.keyfile = /etc/emqx/certs/client-key.pem
|
||||||
|
|
||||||
|
##--------------------------------------------------------------------
|
||||||
|
## HTTP Request Headers
|
||||||
|
##
|
||||||
|
## Example: auth.http.header.Accept-Encoding = *
|
||||||
|
##
|
||||||
|
## Value: String
|
||||||
|
## auth.http.header.Accept = */*
|
||||||
|
|
||||||
|
##--------------------------------------------------------------------
|
||||||
|
## Authentication request.
|
||||||
|
##
|
||||||
|
## Variables:
|
||||||
|
## - %u: username
|
||||||
|
## - %c: clientid
|
||||||
|
## - %a: ipaddress
|
||||||
|
## - %r: protocol
|
||||||
|
## - %P: password
|
||||||
|
## - %p: sockport of server accepted
|
||||||
|
## - %C: common name of client TLS cert
|
||||||
|
## - %d: subject of client TLS cert
|
||||||
|
##
|
||||||
|
## Value: URL
|
||||||
|
auth.http.auth_req = http://java:8080/iot/tool/mqtt/auth
|
||||||
|
## Value: post | get | put
|
||||||
|
auth.http.auth_req.method = post
|
||||||
|
## Value: Params
|
||||||
|
auth.http.auth_req.params = clientid=%c,username=%u,password=%P
|
||||||
|
|
||||||
|
##--------------------------------------------------------------------
|
||||||
|
## Superuser request.
|
||||||
|
##
|
||||||
|
## Variables:
|
||||||
|
## - %u: username
|
||||||
|
## - %c: clientid
|
||||||
|
## - %a: ipaddress
|
||||||
|
## - %r: protocol
|
||||||
|
## - %P: password
|
||||||
|
## - %p: sockport of server accepted
|
||||||
|
## - %C: common name of client TLS cert
|
||||||
|
## - %d: subject of client TLS cert
|
||||||
|
##
|
||||||
|
## Value: URL
|
||||||
|
# auth.http.super_req = http://127.0.0.1:8991/mqtt/superuser
|
||||||
|
## Value: post | get | put
|
||||||
|
# auth.http.super_req.method = post
|
||||||
|
## Value: Params
|
||||||
|
# auth.http.super_req.params = clientid=%c,username=%u
|
||||||
|
|
||||||
|
##--------------------------------------------------------------------
|
||||||
|
## ACL request.
|
||||||
|
##
|
||||||
|
## Variables:
|
||||||
|
## - %A: 1 | 2, 1 = sub, 2 = pub
|
||||||
|
## - %u: username
|
||||||
|
## - %c: clientid
|
||||||
|
## - %a: ipaddress
|
||||||
|
## - %r: protocol
|
||||||
|
## - %m: mountpoint
|
||||||
|
## - %t: topic
|
||||||
|
##
|
||||||
|
## Value: URL
|
||||||
|
# auth.http.acl_req = http://127.0.0.1:8991/mqtt/acl
|
||||||
|
## Value: post | get | put
|
||||||
|
# auth.http.acl_req.method = get
|
||||||
|
## Value: Params
|
||||||
|
# auth.http.acl_req.params = access=%A,username=%u,clientid=%c,ipaddr=%a,topic=%t,mountpoint=%m
|
||||||
|
|
||||||
|
##------------------------------------------------------------------------------
|
||||||
|
## Http Reqeust options
|
||||||
|
|
||||||
|
## Time-out time for the http request, 0 is never timeout.
|
||||||
|
##
|
||||||
|
## Value: Duration
|
||||||
|
## -h: hour, e.g. '2h' for 2 hours
|
||||||
|
## -m: minute, e.g. '5m' for 5 minutes
|
||||||
|
## -s: second, e.g. '30s' for 30 seconds
|
||||||
|
##
|
||||||
|
## Default: 0
|
||||||
|
## auth.http.request.timeout = 0
|
||||||
|
|
||||||
|
## Connection time-out time, used during the initial request
|
||||||
|
## when the client is connecting to the server
|
||||||
|
##
|
||||||
|
## Value: Duration
|
||||||
|
##
|
||||||
|
## Default is same with the timeout option
|
||||||
|
## auth.http.request.connect_timout = 0
|
||||||
|
|
||||||
|
## Re-send http reuqest times
|
||||||
|
##
|
||||||
|
## Value: integer
|
||||||
|
##
|
||||||
|
## Default: 3
|
||||||
|
auth.http.request.retry_times = 3
|
||||||
|
|
||||||
|
## The interval for re-sending the http request
|
||||||
|
##
|
||||||
|
## Value: Duration
|
||||||
|
##
|
||||||
|
## Default: 1s
|
||||||
|
auth.http.request.retry_interval = 1s
|
||||||
|
|
||||||
|
## The 'Exponential Backoff' mechanism for re-sending request. The actually
|
||||||
|
## re-send time interval is `interval * backoff ^ times`
|
||||||
|
##
|
||||||
|
## Value: float
|
||||||
|
##
|
||||||
|
## Default: 2.0
|
||||||
|
auth.http.request.retry_backoff = 2.0
|
||||||
22
docker/data/emqx/conf/emqx_web_hook.conf
Normal file
22
docker/data/emqx/conf/emqx_web_hook.conf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
web.hook.api.url = http://java:8080/iot/tool/mqtt/webhook
|
||||||
|
|
||||||
|
## Encode message payload field
|
||||||
|
##
|
||||||
|
## Value: base64 | base62
|
||||||
|
##
|
||||||
|
## Default: undefined
|
||||||
|
## web.hook.encode_payload = base64
|
||||||
|
|
||||||
|
# web.hook.rule.client.connect.1 = {"action": "on_client_connect"}
|
||||||
|
# web.hook.rule.client.connack.1 = {"action": "on_client_connack"}
|
||||||
|
web.hook.rule.client.connected.1 = {"action": "on_client_connected"}
|
||||||
|
web.hook.rule.client.disconnected.1 = {"action": "on_client_disconnected"}
|
||||||
|
# web.hook.rule.client.subscribe.1 = {"action": "on_client_subscribe"}
|
||||||
|
# web.hook.rule.client.unsubscribe.1 = {"action": "on_client_unsubscribe"}
|
||||||
|
# web.hook.rule.session.subscribed.1 = {"action": "on_session_subscribed"}
|
||||||
|
# web.hook.rule.session.unsubscribed.1 = {"action": "on_session_unsubscribed"}
|
||||||
|
# web.hook.rule.session.terminated.1 = {"action": "on_session_terminated"}
|
||||||
|
# web.hook.rule.message.publish.1 = {"action": "on_message_publish"}
|
||||||
|
# web.hook.rule.message.delivered.1 = {"action": "on_message_delivered"}
|
||||||
|
# web.hook.rule.message.acked.1 = {"action": "on_message_acked"}
|
||||||
Binary file not shown.
2538
docker/data/mysql/initdb/wumei-smart.sql
Normal file
2538
docker/data/mysql/initdb/wumei-smart.sql
Normal file
File diff suppressed because it is too large
Load Diff
5
docker/data/mysql/mysql.cnf
Normal file
5
docker/data/mysql/mysql.cnf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[client]
|
||||||
|
default-character-set=utf8
|
||||||
|
|
||||||
|
[mysql]
|
||||||
|
default-character-set=utf8
|
||||||
55
docker/data/nginx/nginx.conf
Normal file
55
docker/data/nginx/nginx.conf
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_min_length 1k;
|
||||||
|
gzip_buffers 16 64K;
|
||||||
|
gzip_http_version 1.1;
|
||||||
|
gzip_comp_level 5;
|
||||||
|
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_proxied expired no-cache no-store private auth;
|
||||||
|
gzip_disable "MSIE [1-6]\.";
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
charset utf-8;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /prod-api/ {
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header REMOTE-HOST $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_pass http://java:8080/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/v4/ {
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header REMOTE-HOST $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_pass http://emqx:8081/api/v4/;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user