Merge pull request #886 from BinkyTwin/codex/add-thingsboard-template

feat: add ThingsBoard template
This commit is contained in:
Mauricio Siu
2026-07-08 10:20:17 -06:00
committed by GitHub
4 changed files with 146 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
version: "3.8"
services:
thingsboard:
image: thingsboard/tb-node:4.3.1.1
restart: unless-stopped
depends_on:
thingsboard-db:
condition: service_healthy
thingsboard-init:
condition: service_completed_successfully
expose:
- "8080"
environment:
TB_SERVICE_ID: tb-ce-node
TB_QUEUE_TYPE: in-memory
JAVA_OPTS: ${JAVA_OPTS}
SPRING_DATASOURCE_URL: jdbc:postgresql://thingsboard-db:5432/${POSTGRES_DB}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
SECURITY_CORS_ALLOWED_ORIGINS: ${SECURITY_CORS_ALLOWED_ORIGINS}
volumes:
- thingsboard-logs:/var/log/thingsboard
healthcheck:
test: ["CMD-SHELL", "timeout 5 bash -c '</dev/tcp/127.0.0.1/8080'"]
interval: 30s
timeout: 10s
retries: 10
start_period: 300s
thingsboard-init:
image: thingsboard/tb-node:4.3.1.1
restart: on-failure
# The image runs as the non-root "thingsboard" user, which cannot write
# the install marker to the freshly created (root-owned) /data volume.
user: root
depends_on:
thingsboard-db:
condition: service_healthy
command:
- bash
- -c
- |
set -e
if [ -f /data/.thingsboard-installed ]; then
echo "ThingsBoard database already initialized."
exit 0
fi
INSTALL_TB=true LOAD_DEMO=$${LOAD_DEMO:-false} start-tb-node.sh
touch /data/.thingsboard-installed
environment:
TB_SERVICE_ID: tb-ce-node
TB_QUEUE_TYPE: in-memory
JAVA_OPTS: ${JAVA_OPTS}
LOAD_DEMO: ${LOAD_DEMO}
SPRING_DATASOURCE_URL: jdbc:postgresql://thingsboard-db:5432/${POSTGRES_DB}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- thingsboard-install:/data
- thingsboard-logs:/var/log/thingsboard
thingsboard-db:
image: postgres:18
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- thingsboard-db:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
thingsboard-db:
thingsboard-install:
thingsboard-logs:

View File

@@ -0,0 +1,18 @@
{
"id": "thingsboard",
"name": "ThingsBoard",
"version": "4.3.1.1",
"description": "ThingsBoard is an open-source IoT platform for device management, data collection, processing, visualization, and automation.",
"logo": "thingsboard.svg",
"links": {
"github": "https://github.com/thingsboard/thingsboard",
"website": "https://thingsboard.io/",
"docs": "https://thingsboard.io/docs/"
},
"tags": [
"iot",
"device-management",
"monitoring",
"visualization"
]
}

View File

@@ -0,0 +1,43 @@
[variables]
main_domain = "${domain}"
postgres_password = "${password:32}"
load_demo = "false"
java_opts = "-Xms512m -Xmx2048m"
[[config.domains]]
serviceName = "thingsboard"
port = 8080
host = "${main_domain}"
path = "/"
[[config.mounts]]
filePath = "README.md"
content = """# ThingsBoard
This template deploys ThingsBoard Community Edition with PostgreSQL using the official `thingsboard/tb-node` Docker image.
## First start
The `thingsboard-init` service initializes the database once before the main service starts. By default it performs a clean install. Set `load_demo` to `true` before deploying if you want ThingsBoard's sample tenant, dashboards, and demo devices.
## Login
Open `https://${main_domain}` and sign in with the default system administrator account:
- Email: `sysadmin@thingsboard.org`
- Password: `sysadmin`
Change the default password before exposing the instance to production users.
## Device connectivity
The web UI and HTTP device API are available through the configured domain. MQTT, CoAP, and additional transport ports are not publicly exposed by this template; expose them separately in Dokploy if your deployment requires direct device connections over those protocols.
"""
[config.env]
POSTGRES_DB = "thingsboard"
POSTGRES_USER = "postgres"
POSTGRES_PASSWORD = "${postgres_password}"
LOAD_DEMO = "${load_demo}"
JAVA_OPTS = "${java_opts}"
SECURITY_CORS_ALLOWED_ORIGINS = "http://${main_domain},https://${main_domain}"

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M409.14.02c11.906-.506 21.786 8.866 21.787 20.773 0 5.572-1.774 11.146-5.827 15.199-16.467 16.719-44.841 45.09-50.162 50.41l50.414 50.413 50.922-50.918c3.8-3.547 8.867-5.573 13.934-5.827 11.907-.506 21.787 8.867 21.787 20.773 0 5.573-1.774 11.146-5.827 15.2l-50.921 50.916 47.628 46.864a25.687 25.687 0 0 1 0 36.48l-62.828 62.822c.764.764 34.201 33.946 51.174 51.171 3.546 3.8 5.573 8.866 5.827 13.933.506 11.905-8.867 21.785-20.774 21.785-5.573 0-11.146-1.773-15.2-5.826-17.985-17.73-49.903-49.646-51.175-50.917l-66.122 66.116s33.948 33.692 51.175 51.171c3.547 3.8 5.574 8.866 5.827 13.932.507 11.906-8.867 21.785-20.774 21.785-5.574 0-11.147-1.773-15.2-5.826l-51.175-51.17-62.828 62.823a25.692 25.692 0 0 1-36.481 0L167.2 454.984c-2.534 2.788-34.201 34.706-50.921 51.171-3.8 3.547-8.867 5.573-13.933 5.827-11.907.506-21.788-8.867-21.788-20.773 0-5.573 1.773-11.146 5.826-15.199l50.922-50.917-50.416-50.41c-2.534 2.532-34.454 34.45-51.175 50.916-3.8 3.546-8.867 5.574-13.934 5.827-11.907.506-21.787-8.867-21.787-20.773 0-5.573 1.774-11.146 5.827-15.199l50.921-50.917-46.36-45.85a25.684 25.684 0 0 1 0-36.479l62.828-62.824c-3.293-3.293-34.708-34.45-50.922-50.917-3.546-3.8-5.572-8.866-5.826-13.933-.253-6.079 2.026-11.652 5.826-15.452 3.8-3.8 9.12-6.333 15.2-6.333 5.574 0 11.148 1.773 15.201 5.826 17.48 17.226 47.628 47.371 50.921 50.664l65.868-65.863-50.92-50.918c-3.547-3.8-5.574-8.613-5.828-13.933-.506-11.906 8.867-21.785 20.774-21.785 5.573 0 11.147 1.774 15.2 5.827l50.668 50.664L262.2 10.155a25.691 25.691 0 0 1 36.482 0l46.107 46.104 50.415-50.41c3.8-3.547 8.867-5.573 13.934-5.827zM293.87 108.95c-5.827-.252-11.654 2.28-15.961 6.587-2.027 2.027-3.8 4.56-4.813 7.093l-20.521 49.397c-4.053 9.373-1.013 20.266 7.601 25.333 8.613 5.066 19.76 3.293 26.853-4.56l10.388 40.784-113.24 34.452c-11.147 3.294-17.987 14.946-15.2 26.092l25.84 100.82c2.787 11.146 14.187 17.479 25.587 13.933 11.401-3.547 18.241-15.2 15.2-26.346l-21.026-80.808 113.24-34.451c11.147-3.294 17.987-15.201 15.2-26.093l-15.453-60.797c9.627 2.786 20.267-1.773 25.08-11.146 4.814-9.373 2.534-20.52-5.32-25.84l-41.801-30.65c-3.293-2.533-7.346-3.8-11.653-3.8z" fill="#305680"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB