Skip to content
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

Documentation: Docker Support #19

Open
digital-dann opened this issue Jun 23, 2021 · 3 comments
Open

Documentation: Docker Support #19

digital-dann opened this issue Jun 23, 2021 · 3 comments

Comments

@digital-dann
Copy link

After some fiddling, I found a way to build a Docker container for this. Docker my preferred way to run this, even on a Raspberry Pi. Some people might find this useful, too:

Dockerfile

FROM node:10-buster

RUN git clone https://github.com/gleeds/cloudbbq.git \
  && cd cloudbbq \
  && npm install

COPY docker-entrypoint.sh /entrypoint.sh

RUN chmod u+x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

docker-entrypoint.sh

#!/bin/sh

cd /cloudbbq
exec npm start

docker-compose.yml

version: '3'
services:
  cloudbqq:
    container_name: cloudbbq
    image: cloudbbq:latest
    network_mode: host
    volumes:
      - ./default.json:/cloudbbq/config/default.json
    restart: unless-stopped
@gleeds
Copy link
Owner

gleeds commented Jun 23, 2021

Interesting. I like this because for people who don't need to make changes to the software, it gets around all of the pain of getting the native node modules to compile with a specific Node version. It's also a pleasant surprise that the bluetooth stack is accessible in the container.

It would be nice to just build an "official" container and put it in a public registry, though GitHub's Runners appear to only support x86 right now and I don't think there is an easy free way to do this in ARM with a self-hosted runner.

I'll give this some more thought if there is a better way to incorporate this.

@digital-dann
Copy link
Author

digital-dann commented Jun 24, 2021

It would be simple enough to create a DOCKER.md file with this information and just link to it from the README.md. If you create a Docker Hub repo for this, I would be willing to upload images for this. You may want to start creating releases in Github to match the docker image releases as well.

Beyond this, there are many things that can be done to improve the MQTT compatibility and also ways to tweak the Docker image to make it much more user friendly. I'm open to submitting merge requests.

@gleeds
Copy link
Owner

gleeds commented Jun 26, 2021

Turns out I was wrong earlier, docker buildx works on the GitHub runners, so while slow I can indeed have the CI pipeline build arm and arm64 containers. I tested a container built this way on a Pi 3 with 32bit PiOS and it seems to work, but I'd love for you to give it a try too. You can try this compose file.
https://github.com/gleeds/cloudbbq/blob/master/docker-compose.yml

I think for this container to be generally friendly to use, cloudbbq would need a better configuration system (Kinda like what Spring Boot does) that can load from both a config file or from environmental variables.

Also, I'm interested in what MQTT changes you'd like to see. In the past I tried to get it to work with AWS IoT Core but couldn't get past their more complex auth system at the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants