marthoc / docker-homeseer

HomeSeer HS3 Docker Image
https://hub.docker.com/r/marthoc/homeseer/
MIT License
13 stars 12 forks source link

FYI I created a HS4 beta fork #20

Open scyto opened 4 years ago

scyto commented 4 years ago

Not sure if anyone else created a fork for this purpose?

If you would like to pull this to a beta repository and tag let me know if there is anything you want me to do. I may play with using buildx to do a multiarch tag / build too.

https://hub.docker.com/repository/docker/scyto/docker-homeseer4beta https://github.com/scyto/docker-homeseer

Fellhahn commented 4 years ago

scyto I can't see an issues section on your own fork to ask this question. How likely do think it is you'll continue to support the HS4 fork?

Is it possible to update the HS4 application within the container sing some kind of docker exec command?

scyto commented 4 years ago

Not sure why you cant file a bug on the fork, will look.

I just reminded myself of the code, the version of HS used is set by a default env var thanks to who ever converted to S6 I think?

When you do docker run command just use the version you want with an env var parameter on the command line to override the default version.

I can update the image default later this week and re-push to docker hub.

I hadn’t progressed the fork as I didn’t know any one was using my image, lol. :-)

scyto commented 4 years ago

@Fellhahn ok github and dockerhub updated, build logs look good but i haven't had chance to spin it up and test, can you give it a quick run?

Also enabled issues on my fork - no idea why it was disabled, maybe its because it is a fork.

This reminds me i need to see what architectures S6 works on and see if i can do multiplatform build.... depends if HS has architecture dependent binaries in it....

Once HS4 goes GA I will add vars to choose HS3 or HS4 and propose the changes as upstream change.

Fellhahn commented 4 years ago

Awesome, thanks for such a fast response.

Stopped the HS4 container, removed, pulled the image again and re-ran 'docker-compose up'. Confirmed it downloaded HS 4.0.7.0 and starts without any noticeable issues.

A note for others, set your restart policy to "unless-stopped" instead of "always". Otherwise the container seems to restart when you perform the shutdown from within the HS UI?

And yes that version ENV variable works a treat. Added:

Under the environment: section of the compose file, re-upped and the container started with version 4.0.6.0.

Seeing how it downloads the homeseer installer at first run, adding a HS3/HS4 ENV veriable seems a nice clean solution. Makes it possible for users to pin to a certain build version as well.

While I'm yet to actually move my z-wave interface over, I'm pretty darn happy with this so far, so big thanks.

scyto commented 4 years ago

You are welcome, I am still running an ISY-994i as my primary controller because I have mix of Insteon and zwave. I have it on my list to seriously take another look at HS. I stopped a few weeks ago because of bugs affecting some plugins. I am hoping the new version fixed them.

Since I last posted I finally got around to looking at compose and stack files, docker run in a script is just as effective, lol. Been messing with portainer and swarm mode. Very interesting.

danielbrunt57 commented 3 years ago

Hey, I have a question... Does HS gracefully shutdown from a docker stop or a docker restart?

dotchance commented 3 years ago

No. Due to the whole windows dependencies it just kills the processes. But I haven't seen an issue with the database due to the sudden stop.

.chance

On Sat, Nov 28, 2020 at 2:06 PM Daniel notifications@github.com wrote:

Hey, I have a question... Does HS gracefully shutdown from a docker stop or a docker restart?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/marthoc/docker-homeseer/issues/20#issuecomment-735290488, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDWB525GGASEZJQIXR6OYDSSFQ6HANCNFSM4MCOG5FQ .

danielbrunt57 commented 3 years ago

Is it possible to use a systemd service inside the container and if so, would docker stop execute systemctl stop HS4?

[Unit]
Description=HomeSeer HS4 Home Automation
Documentation=https://homeseer.com/support-home/
After=network-online.target remote-fs.target time-sync.target
Before=multi-user.target

[Service]
WorkingDirectory=/usr/local/HomeSeer
ExecStart=/usr/bin/mono HSConsole.exe --log
SyslogIdentifier=HomeSeer HS4
StandardOutput=null
Restart=on-failure
RestartSec=30
KillMode=none
TimeoutStopSec=300
ExecStop=/usr/local/HomeSeer/hsstop.sh

[Install]
WantedBy=multi-user.target
danielbrunt57 commented 3 years ago

It looks like docker-homeseer4/rootfs/etc/services.d/homeseer/finish runs

#!/usr/bin/with-contenv sh

[ "$TERMINATE_ON_ERROR" = "1" ] && s6-svscanctl -t /var/run/s6/services

Could this somehow execute /usr/local/HomeSeer/hsstop.sh?