Skip to content

Dockerized Counter thing #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ HC_INTERVAL=40s
HC_TIMEOUT=30s
HC_RETRIES=3
HC_START_PERIOD=60s

# Email Configuration (optional)
SMTP_HOST=sandbox.smtp.mailtrap.io
SMTP_PORT=2525
SMTP_USER=47aa65a98dd245
SMTP_PASS=b553f1f0235cde
[email protected]

# Telegram Configuration (optional)
TELEGRAM_BOT_TOKEN=your-bot-token
TELEGRAM_CHAT_ID=your-chat-id
12 changes: 12 additions & 0 deletions docker-compose-things.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MQTT broker should not be here but the counter thing should be added

Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ services:
memory: 25M
networks:
- things_network
mqtt-broker:
image: eclipse-mosquitto:2.0
ports:
- "1883:1883" # MQTT
- "9001:9001" # WebSocket
volumes:
- ./mosquitto/config:/mosquitto/config
- ./mosquitto/data:/mosquitto/data
- ./mosquitto/log:/mosquitto/log
networks:
- things_network

networks:
things_network:
name: things_network
Expand Down
Binary file added monitoring/.DS_Store
Binary file not shown.
Binary file added monitoring/thing-monitor/.DS_Store
Binary file not shown.
41 changes: 41 additions & 0 deletions monitoring/thing-monitor/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# IN PORTS
WEB_PORT_IN=80
MODBUS_ELEVATOR_PORT_IN=3179
COAP_SIMPLE_PORT_IN=5683
COAP_NEGOTIATION_PORT_IN=5684
SMART_HOME_SMART_CLOCK_PORT_IN=5685
TRAEFIK_DASHBOARD_PORT_IN=8080

# OUT PORTS
WEB_PORT_OUT=80
MODBUS_ELEVATOR_PORT_OUT=3179
COAP_SIMPLE_PORT_OUT=5683
COAP_NEGOTIATION_PORT_OUT=5684
SMART_HOME_SMART_CLOCK_PORT_OUT=5685
TRAEFIK_DASHBOARD_PORT_OUT=8080

STACK_HOSTNAME="plugfest.thingweb.io"
BROKER_URI="plugfest.thingweb.io"
PORT=8087

LOKI_HOSTNAME="http://loki"
LOKI_PORT=3100

# Healthcheck Parameters
HC_INTERVAL=40s
HC_TIMEOUT=30s
HC_RETRIES=3
HC_START_PERIOD=60s

# Email Configuration (optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_USER=email-here
SMTP_PASS=app-password-here
NOTIFICATION_EMAIL=recieving-email-here

THINGS_TO_MONITOR=\
advanced-coffee-machine,http,localhost,3000,/http-advanced-coffee-machine;\
elevator,modbus,localhost,8502;\
calculator,http,localhost,3000,/http-express-calculator-simple;\
data-schema-thing,http,localhost,3000,/http-data-schema-thing
21 changes: 21 additions & 0 deletions monitoring/thing-monitor/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:18-alpine

WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy source code
COPY . .

# Build TypeScript code
RUN npm run build

# Expose the API port
EXPOSE 3000

# Set the default command to run the test script
CMD ["npm", "run", "test:monitor"]
Loading