diff --git a/docker/modules/websocket/deploy/deploy.yaml b/docker/modules/websocket/deploy/deploy.yaml new file mode 100644 index 0000000..a818fd8 --- /dev/null +++ b/docker/modules/websocket/deploy/deploy.yaml @@ -0,0 +1,66 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: iot-box-websocket-api + name: iot-box-websocket-api + namespace: qiuguo-iot #一定要写名称空间 +spec: + progressDeadlineSeconds: 600 + replicas: 1 + selector: + matchLabels: + app: iot-box-websocket-api + strategy: + rollingUpdate: + maxSurge: 50% + maxUnavailable: 50% + type: RollingUpdate + template: + metadata: + labels: + app: iot-box-websocket-api + spec: + imagePullSecrets: + - name: aliyun-hub-register #提前在项目下配置访问阿里云的账号密码 + containers: + - image: $REGISTRY/$DOCKERHUB_NAMESPACE/qiuguo-iot:iot-box-websocket-api-SNAPSHOT-v1.0.0 + readinessProbe: + httpGet: + path: /actuator/health + port: 8080 + timeoutSeconds: 10 + failureThreshold: 30 + periodSeconds: 5 + imagePullPolicy: Always + name: app + ports: + - containerPort: 8080 + protocol: TCP + resources: + limits: + cpu: 300m + memory: 600Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + terminationGracePeriodSeconds: 30 +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: iot-box-websocket-api + name: iot-box-websocket-api + namespace: qiuguo-iot +spec: + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: iot-box-websocket-api + sessionAffinity: None + type: ClusterIP diff --git a/docker/modules/websocket/dockerfile b/docker/modules/websocket/dockerfile new file mode 100644 index 0000000..a3c6a7b --- /dev/null +++ b/docker/modules/websocket/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM openjdk:8-jre +# author +MAINTAINER qiuguo + +# 挂载目录 +VOLUME /home/qiuguo +# 创建目录 +RUN mkdir -p /home/qiuguo +# 指定路径 +WORKDIR /home/qiuguo +# 复制jar文件到路径 +COPY ./jar/iot-box-websocket-api.jar /home/qiuguo/iot-box-websocket-api.jar +# 启动网关服务 +ENTRYPOINT ["java","-jar","iot-box-websocket-api.jar"] \ No newline at end of file diff --git a/docker/modules/websocket/jar/ReadMe.md b/docker/modules/websocket/jar/ReadMe.md new file mode 100644 index 0000000..98c66f4 --- /dev/null +++ b/docker/modules/websocket/jar/ReadMe.md @@ -0,0 +1 @@ +别删 \ No newline at end of file diff --git a/iot-gateway/pom.xml b/iot-gateway/pom.xml index 9562324..9516122 100644 --- a/iot-gateway/pom.xml +++ b/iot-gateway/pom.xml @@ -44,13 +44,12 @@ - + org.springframework.boot spring-boot-starter-actuator - diff --git a/iot-gateway/src/main/resources/bootstrap.yml b/iot-gateway/src/main/resources/bootstrap.yml index af52220..8efac3c 100644 --- a/iot-gateway/src/main/resources/bootstrap.yml +++ b/iot-gateway/src/main/resources/bootstrap.yml @@ -10,10 +10,10 @@ spring: nacos: discovery: # 服务注册地址iot-nacos.qiuguo-iot - server-addr: iot-nacos.qiuguo-iot:8848 + server-addr: 192.168.8.146:32470 config: # 配置中心地址 - server-addr: iot-nacos.qiuguo-iot:8848 + server-addr: 192.168.8.146:32470 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/iot-modules/iot-box-websocket-api/src/main/resources/bootstrap.yml b/iot-modules/iot-box-websocket-api/src/main/resources/bootstrap.yml index 7980313..78ef332 100644 --- a/iot-modules/iot-box-websocket-api/src/main/resources/bootstrap.yml +++ b/iot-modules/iot-box-websocket-api/src/main/resources/bootstrap.yml @@ -1,5 +1,5 @@ server: - port: 9999 + port: 8080 spring: profiles: # 环境配置 @@ -10,43 +10,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 192.168.8.101:8848 + server-addr: iot-nacos.qiuguo-iot:8848 config: # 配置中心地址 - server-addr: 192.168.8.101:8848 + server-addr: iot-nacos.qiuguo-iot:8848 # 配置文件格式 file-extension: yml # 共享配置 shared-configs: - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - redis: - # cluster: - # nodes: - # - 127.0.0.1:7001 - # - 127.0.0.1:7002 - host: 192.168.8.101 - port: 6379 - password: 123456 - timeout: 5000 - r2dbc: - #注意下面修改 easyorm相关也需要修改 - #url: r2dbc:postgresql://localhost:5432/postgres #postgresql请使用此配置 - url: r2dbc:mysql://172.24.218.235:3306/qiuguo_iot?ssl=false&serverZoneId=Asia/Shanghai # mysql请使用此配置 - #url: r2dbc:h2:file:///./data/h2db/jetlinks - username: root - password: '!pHuRvGKIsbiqcX1' -easyorm: - auto-ddl: false #是否根据实体类型更新数据库字段(增加、属性) - default-schema: qiuguo_iot # 默认使用的schema. mysql时则为数据库名 - dialect: mysql # 方言: h2,mysql,postgresql -logging: - config: classpath:logback-${spring.profiles.active}.xml - level: - org.hswebframework: debug - org.hswebframework.expands: error - com.qiuguo.iot.data: debug #可以开启sql的日志打印 -device: - checkTimeout: false #是否检测请求超时 - timeout: 120000 #超时时间 毫秒 -lac: #lac服务地址 - url: http://127.0.0.1:8866 \ No newline at end of file