Add Homeassistant container
This commit is contained in:
parent
6c0a690e86
commit
9f723d9026
3 changed files with 62 additions and 0 deletions
5
homeassistant/.env-example
Normal file
5
homeassistant/.env-example
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Homeassistant Version (Standard: latest)
|
||||||
|
HOMEASSISTANT_VERSION=latest
|
||||||
|
|
||||||
|
# Homeassistant Domain
|
||||||
|
HOMEASSISTANT_DOMAIN=Homeassistant.example.com
|
27
homeassistant/README.md
Normal file
27
homeassistant/README.md
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# HomeassistantDocker Deployment
|
||||||
|
|
||||||
|
This repository provides a `docker-compose` configuration for deploying the Homeassistant container, which is accessible via Traefik as a reverse proxy.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
- Docker and Docker Compose must be installed
|
||||||
|
- Traefik must be set up as a reverse proxy
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. **Configure the `.env` file**
|
||||||
|
Rename the `.env-example` file to `.env` and update the file with your specific values. This file contains environment variables used by the Traefik service.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mv .env-example .env
|
||||||
|
```
|
||||||
|
Modify the .env file
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Start Docker-Compose**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## Access
|
||||||
|
Once the container is running, Homeassistant will be available at the configured domain.
|
30
homeassistant/docker-compose.yml
Normal file
30
homeassistant/docker-compose.yml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
---
|
||||||
|
services:
|
||||||
|
homeassistant:
|
||||||
|
container_name: homeassistant
|
||||||
|
image: "ghcr.io/home-assistant/home-assistant:${HOMEASSISTANT_VERSION:-latest}"
|
||||||
|
volumes:
|
||||||
|
- ./data/config:/config
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
- /run/dbus:/run/dbus:ro
|
||||||
|
restart: unless-stopped
|
||||||
|
privileged: true
|
||||||
|
network_mode: host
|
||||||
|
environment:
|
||||||
|
- TZ=Europe/Rome
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- NET_BIND_SERVICE
|
||||||
|
- SYS_ADMIN
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.docker.network=traefik"
|
||||||
|
- "traefik.http.routers.homeassistant.entrypoints=http"
|
||||||
|
- "traefik.http.routers.homeassistant.rule=Host(`${HOMEASSISTANT_DOMAIN:?error}`)"
|
||||||
|
- "traefik.http.middlewares.homeassistant-https-redirect.redirectscheme.scheme=https"
|
||||||
|
- "traefik.http.routers.homeassistant.middlewares=homeassistant-https-redirect"
|
||||||
|
- "traefik.http.routers.homeassistant-secure.entrypoints=https"
|
||||||
|
- "traefik.http.routers.homeassistant-secure.rule=Host(`${HOMEASSISTANT_DOMAIN:?error}`)"
|
||||||
|
- "traefik.http.routers.homeassistant-secure.tls=true"
|
||||||
|
- "traefik.http.routers.homeassistant-secure.service=homeassistant"
|
||||||
|
- "traefik.http.services.homeassistant.loadbalancer.server.port=8123"
|
Loading…
Add table
Reference in a new issue