HUB
Sign inSign up

fabiopasilva1/ecoweb-socket

By fabiopasilva1

•Updated over 2 years ago

O ECOWEBSOCKET é um serviço que permite a comunicação entre os dispositivos e o sistema

Image
API management
Web servers
0

10K+

fabiopasilva1/ecoweb-socket repository overview

⁠ECOWEBSOCKET

  • V 1.0.3 -- Version nots :) --- > Fix error in Authentication type Bearer token

  • V 1.0.1 -- Version notes :) --- > Added possibility to configure colors via ENV

⁠Description

ECOWEBSOCKET is a service designed to enable communication between devices and the system using Socket.io and MQTT. The system requires the following dependencies:

  "cors": "^2.8.5",
  "dotenv": "^16.4.5",
  "express": "^4.19.2",
  "jsonwebtoken": "^9.0.2",
  "mqtt": "^5.7.0",
  "socket.io": "^4.7.5",
  "swagger-ui-express": "^5.0.0",
  "winston": "^3.13.0",
  "winston-daily-rotate-file": "^5.0.0"

Environment Variables

 ENV PORT=1883
 ENV SECRET_KEY=your_secret_key
 ENV MQTT_PROTOCOL=mqtt
 ENV MQTT_BROKER_HOST=your_host
 ENV MQTT_PORT=your_port
 ENV MQTT_USERNAME=username
 ENV MQTT_PASSWORD=password
 ENV SOCKET_CORS=http://localhost:3000,http://localhost:3001

⁠Execution

To execute the image, input the environment variables as shown in the following example directly into the terminal: Remember to change the values between .

docker run -p 1883:1883 --name ecoweb-socket -d -e PORT=1883 -e SECRET_KEY=<your_secret_key> -e MQTT_PROTOCOL=mqtt -e MQTT_BROKER_HOST=<your_host> -e MQTT_USERNAME=<username> -e MQTT_PASSWORD=<password> -e SOCKET_CORS=http://localhost:3000,http://localhost:3001

⁠To run with docker-compose.yml

Create a file named docker-compose.yml and insert the following code:

version: '3.9'
services:
    ecoweb-socket:
        image: fabiopasilva1/ecoweb-socket:latest
        ports:
            - "1883:1883"
        environment:
            - NODE_ENV=production
            - PORT=1883
            - SECRET_KEY=your_secret_key
            - MQTT_BROKER_HOST=your_host_mqtt
            - MQTT_PORT=port
            - MQTT_USERNAME=username
            - MQTT_PASSWORD=password
            - SOCKET_CORS=http://localhost:3000,http://localhost:3001
        restart: always
        

Execute the following command in the terminal:

docker-compose up -d
Tag summary
Recent tags
Content type
Image
Digest
sha256:2894f9ff5…
Size
69.3 MB
Last updated
over 2 years ago
docker pull fabiopasilva1/ecoweb-socket:latest