Improves documentation on deploying via docker (ex: devices and compose) (#3981)

* Removes extraneous paragraph from docker documentation

It looks like this line was intended to go somewhere else, but got
erroneously bumped into the `Restart` section.

* Adds instructions to expose devices when deploying under docker

* Adds info about `docker-compose.yml` configuration to docker deployments

The docker command is pretty complicated and doesn't support automated
restarts. I think most users with want to use `docker-compose` (or
`docker swarm`) to deploy.
This commit is contained in:
mvgrimes 2017-12-20 06:27:23 -05:00 committed by Franck Nijhof
parent e456e3ef96
commit 83e008be84

View File

@ -78,9 +78,55 @@ If you want to use a USB Bluetooth adapter or Z-Wave USB Stick with Home Assista
### {% linkable_title Restart %}
This will launch Home Assistant and serve the web interface from port 8123 on your Docker host.
If you change the configuration you have to restart the server. To do that you have 2 options.
1. You can go to the <img src='/images/screenshots/developer-tool-services-icon.png' alt='service developer tool icon' class="no-shadow" height="38" /> service developer tools, select the service `homeassistant/restart` and click "Call Service".
2. Or you can restart it from a terminal by running `docker restart home-assistant`
### {% linkable_title Docker Compose %}
As the docker command becomes more complex, switching to `docker-compose` can be preferable and support automatically restarting on failure or system restart. Create a `docker-compose.yml` file:
```yaml
version: '3'
services:
web:
image: homeassistant/home-assistant
volumes:
- /path/to/your/config:/config
- /etc/localtime:/etc/localtime:ro
restart: always
network_mode: host
```
Then start the container with:
```bash
$ docker-compose up -d
```
### {% linkable_title Exposing Devices %}
In order to use z-wave, zigbee or other components that require access to devices, you need to map the appropriate device into the container. Ensure the user that is running the container has the correct privileges to access the `/dev/tty*` file, then add the device mapping to your docker command:
```bash
$ docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --device /dev/ttyUSB0:/dev/ttyUSB0 --net=host homeassistant/home-assistant
```
or in a `docker-compose.yml` file:
```yaml
version: '3'
services:
web:
image: homeassistant/home-assistant
volumes:
- /path/to/your/config:/config
- /etc/localtime:/etc/localtime:ro
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/ttyUSB1:/dev/ttyUSB1
- /dev/ttyACM0:/dev/ttyACM0
restart: always
network_mode: host
```