This version (2018/07/30 08:30) is a draft.
Approvals: 0/1
The Previously approved version (2017/07/25 08:45) is available.Diff

We'll install Docker to run BrewPi in a container. This keeps it nicely isolated from the rest of the system and makes it easy to deploy.

Install Docker

Install docker following these instructions:

https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

Install docker-compose:

sudo apt install python-pip
pip install --user docker-compose

Deploy the containers

Copy this code to a file called `docker-compose.yml

version: '3'

services:
  brewpi:
    image: brewpi/brewpi-ubuntu
    restart: always
    privileged: true
    volumes:
      - ~/brewpi-data:/data
      - /etc/timezone:/etc/timezone
      - /etc/localtime:/etc/localtime
    ports:
      - "80:80"

  portainer:
    image: portainer/portainer
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "9000:9000"

Open a terminal in the directory where you saved the file, and run the following command to get started:

docker-compose up -d

This started the BrewPi container, and the Portainer management tool. To stop the containers again, run (still in the same directory):

docker-compose down

You can of course modify the configuration to your liking.

Let's break it down to explain each part:

Parameter Explanation
image: brewpi/brewpi-ubuntu The type of docker container.
restart: always Start on boot, and always restart the container when it stops.
privileged: true The container is allowed to use the computer USB ports
volumes: ~/brewpi-data:/data The container can now read and write all files in the brewpi-data directory.
volumes: /etc/timezone:/etc/timezone The container will use the time and timezone settings from your computer.
volumes: /etc/localtime:/etc/localtime The container will use your computer's current time.
ports: 80:80 Map your computer's port 80 to port 80 on the container. 8000:80 would be port 8000 on your computer, 80 on container.

Connecting the BrewPi Spark via WiFi

This step requires that you both configure the BrewPi Spark itself and your docker instance so it can find your controller on the network. Please follow this guide to configure both. Note that since you are running docker, expect the config.cfg to reside in ~/brewpi-data/settings/ or the folder you specified when ran your container.

Use portainer to access the command line of the brewpi container

After you've started the containers using docker-compose, you can load the portainer web interface: localhost:9000. It will ask you to set an admin password. Pick a password and set it up. Use it to log in on the next page.

On the next page, choose to first option 'Manage the Docker instance where Portainer is running' and click the Connect button.

When you have logged in, you can see your running containers. In this case, there will be a brewpi and a portainer one. If you click on the published port, this will take you to the web interface.

If you click on the brewpi container, you can click on 'console' on the container page. This will drop you directly to the command line of the container if you need it.