Skip to content

Commit

Permalink
use static 5100 for config port for now. docker updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tavdog committed Dec 5, 2024
1 parent 27a208f commit da40996
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 16 deletions.
3 changes: 3 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ services:
ports:
- "8000:8000" # Map port 8000 on the host to port 8000 in the container
- "5100:5100" # 5100 is used for pixlet serve interface during app configuration
# remove the volume when ready for production deployment
volumes:
- .:/app
environment:
- MQTT_BROKER_HOST=mqtt # Name of the MQTT service (hostname inside the Docker network)
- MQTT_BROKER_PORT=1883
Expand Down
25 changes: 15 additions & 10 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN apt update && apt upgrade -y && apt install cron libwebp-dev python3-pip pyt
RUN pip3 install --break-system-packages python-dotenv paho-mqtt python-pidfile
WORKDIR /tmp
RUN curl -fsSL $NODE_URL | bash - && apt-get install -y nodejs && node -v

WORKDIR /
# RUN git clone --depth 1 -b config_merge $PIXLET_REPO /pixlet
RUN apt install unzip
Expand All @@ -27,19 +28,23 @@ RUN mv pixlet-config_merge pixlet
WORKDIR /pixlet
RUN npm install && npm run build && make build

###################################
# install tidbymanager app
COPY . /app
#RUN git clone $TDM_REPO /app
WORKDIR /app
####################################### uncomment all below for final deployment
### during docker development using a mount to the app dir
# ###################################
# # install tidbymanager app
# COPY . /app
# #RUN git clone $TDM_REPO /app
# WORKDIR /app

# # install tidbyt apps
# RUN git clone $TIDBYT_APPS_REPO tidbyt-apps
# # or copy your own list over
# #COPY tidbyt-apps /app/tidbyt-apps

# install tidbyt apps
RUN git clone $TIDBYT_APPS_REPO tidbyt-apps
# or copy your own list over
#COPY tidbyt-apps /app/tidbyt-apps
# # populate the apps.json file
# RUN python3 ./gen_app_array.py

# populate the apps.json file
RUN python3 ./gen_app_array.py
# install the crontab directly
RUN echo '* * * * * root cd /app ; python3 runner.py >> /app/runner.log 2>&1' > /etc/cron.d/tdmrunner
EXPOSE 8000 5100
Expand Down
11 changes: 6 additions & 5 deletions tidbyt_manager/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ def get_all_users():
return users

def get_user_render_port(username):
users = get_all_users()
for i in range(len(users)):
if users[i]['username'] == username:
print(f"got port {i} for {username}")
return 5100+i
return 5100
# users = get_all_users()
# for i in range(len(users)):
# if users[i]['username'] == username:
# print(f"got port {i} for {username}")
# return 5100+i

23 changes: 22 additions & 1 deletion users/admin/admin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
{
"username": "admin",
"password": "pbkdf2:sha256:600000$MejfwNqfHsmefntx$3289f3302f44d15b719d82c409f9da1d52c798c7eab2ee546b361a0cfff91077",
"devices": {},
"devices": {
"9abe2858-554a-4913-92ce-c4c27dd16c53": {
"id": "9abe2858-554a-4913-92ce-c4c27dd16c53",
"name": "Testies",
"api_id": "mqtt://mqtt:1883/Testies",
"api_key": "",
"notes": "",
"apps": {
"879": {
"iname": "879",
"name": "3cellularautomata",
"uinterval": "1",
"display_time": "10 ",
"notes": "",
"enabled": "true",
"last_render": 1733379499,
"last_push": 0,
"path": "tidbyt-apps/apps/3cellularautomata/3cellularautomata.star"
}
}
}
},
"system_repo_url": "tavdog/tidbyt-apps",
"app_repo_url": "tavdog/windytronstarlark"
}

0 comments on commit da40996

Please sign in to comment.