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

README: Add Docker pull installation method #79

Merged
merged 4 commits into from
Feb 13, 2025

Conversation

FabioCanavarro
Copy link
Contributor

@FabioCanavarro FabioCanavarro commented Feb 5, 2025

Fixes #71

This PR adds a new installation method for Bifrost using pre-built Docker images.

Changes

  • Updated installation methods list to include Docker Pull option
  • Added comprehensive Docker Pull section in README
  • Included platform-specific Docker pull commands
  • Provided guidance on running the Docker image with a local configuration file
  • Split the docker installation methods into its own file

@rohankapoorcom
Copy link

One suggestion I would make - add an example docker-compose config as well.

@FabioCanavarro
Copy link
Contributor Author

FabioCanavarro commented Feb 5, 2025

Hmmm, alright, I see, I will edit the pull request later in the afternoon

@rohankapoorcom
Copy link

Overall I think this is a great set of instructions to add, just the docker compose instructions make it even easier to configure. One page I think that shows an amazing set of docker installation instructions is Zigbee 2 MQTT: https://www.zigbee2mqtt.io/guide/installation/02_docker.html#docker-compose if you want something to reference.

@FabioCanavarro
Copy link
Contributor Author

I agree, and also I wish to thank you for making my life easier, I will try checking it out 😁

@FabioCanavarro
Copy link
Contributor Author

FabioCanavarro commented Feb 7, 2025

@rohankapoorcom to double check what you have meant, instead of docker pull, I edit the readme.md file to only include docker compose up -d, from the docker-compose.yml itself? (As I am quite not sure if the original issue wanted me to add docker pull also)

  1. Create a docker-compose.yml file with the following content:
version: '3.8'
services:
  bifrost:
    image: ghcr.io/chrivers/bifrost:master-2025-02-04
    container_name: bifrost
    restart: unless-stopped
    network_mode: host  # Required for mDNS discovery
    volumes:
      - ./config.yaml:/app/config.yaml
      - ./certs:/app/certs  # Certificate storage
    environment:
      - TZ=Europe/Copenhagen  # Set your timezone
 
2. Curl and rename the example configuration file:

```sh
curl -O https://raw.githubusercontent.com/chrivers/bifrost/master/config.example.yaml
cp config.example.yaml config.yaml
  1. Start the container:
docker compose up -d

is it something like this? (Feel free to point my mistakes, as I haven't really touched docker much)

@danieledwardgeorgehitchcock
Copy link

danieledwardgeorgehitchcock commented Feb 8, 2025

If you are willing to sacrifice mDNS discovery in favour of a more isolated Docker network, you can do the following:

docker-compose.yaml:

services:
  bifrost:
    image: ghcr.io/chrivers/bifrost:latest
    container_name: bifrost
    restart: unless-stopped
    networks:
      home-automation: # Docker Compose Defined Network (See Below Networks Section)
        ipv4_address: 172.21.0.6 # Suggest To Run Compose Up Without This Line To Generate IP, Then Make It Static As IP's And MAC's Get Recycled On Reboot
        mac_address: 00:11:22:33:44:55 # See Above Note
    volumes:
      - type: bind # Would Be Great For The Config File To Be In A Separate Directory, And Generated If Missing, Then We Could Use A Docker Volume For This
        source: ./bifrost/config.yaml
        target: /app/config.yaml
      - type: volume # Docker Compose Defined Volume (See Below Volumes Section)
        source: bifrost-certs
        target: /app/certs
    depends_on: # Not Necessarily Needed, But Good To Have When Controlling Service Startup On Boot
      zigbee2mqtt:
        condition: service_started
    ports:
      - 80:80/tcp
      - 443:443/tcp

volumes:
  bifrost-certs:

networks:
  home-automation:
    driver: bridge

config.yaml:

bifrost:
  cert_file: certs/cert.pem
bridge:
  name: Bifrost
  mac: 00:11:22:33:44:55 # Docker Container MAC
  ipaddress: 172.21.0.6 # Docker Container IP
  netmask: 255.255.255.0
  gateway: 172.21.0.1 # Docker Network Gateway
  timezone: Europe/London
z2m:
  zigbee2mqtt:
    url: ws://zigbee2mqtt:8080/api?token=ABC123 # If Your Z2M Instance Is Bound To The Same Docker Network As Bifrost, You Can Use The Container Name

@chrivers
Copy link
Owner

chrivers commented Feb 8, 2025

without mDNS discovery, am I correct in assuming the hue app will stop working?

If so, we should probably make that very clear. I'd prefer not to have more people frustrated and confused about connection problems :)

@chrivers
Copy link
Owner

chrivers commented Feb 8, 2025

@FabioCanavarro thank you for your contribution! I'll take a look 👍

@danieledwardgeorgehitchcock

without mDNS discovery, am I correct in assuming the hue app will stop working?

If so, we should probably make that very clear. I'd prefer not to have more people frustrated and confused about connection problems :)

It'll work, but the process in the app isn't as straightforward.. you have to click on "I need help" then "Manually add IP"

@rohankapoorcom
Copy link

without mDNS discovery, am I correct in assuming the hue app will stop working?

No, the hue app let's you manually specify the IP address of the bridge instead. But some other devices won't find the hue bridge that way (for example Harmony Hub).

I believe both Docker Compose examples look good!

Copy link
Owner

@chrivers chrivers left a comment

Choose a reason for hiding this comment

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

Looking good - a couple of things to fix, but on the right path for sure. Thank you for submitting this :)

@FabioCanavarro
Copy link
Contributor Author

My bad, had an exam at school, i will start updating it

Copy link
Owner

@chrivers chrivers left a comment

Choose a reason for hiding this comment

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

@FabioCanavarro thanks for updating it!

Don't worry about the delay - exams are important, and we all have a real life to take care of outside of github :)

I have a few more changes, but then I think we're good 👍

@FabioCanavarro
Copy link
Contributor Author

I have synced my new commit; can you review my new commit?

@chrivers chrivers force-pushed the Add-Docker-Pull-Method branch from 1ca9e8c to 04a89a5 Compare February 13, 2025 17:04
Signed-off-by: Christian Iversen <ci@iversenit.dk>
@chrivers chrivers merged commit 8957fa4 into chrivers:master Feb 13, 2025
1 check passed
@chrivers
Copy link
Owner

@FabioCanavarro Merged! Thanks for your contribution 🥳

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

Successfully merging this pull request may close these issues.

Make docker download clearer (was: Publish Image To Docker Registry)
4 participants