chore: add mariadb database
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1 +1,5 @@
|
|||||||
.env.mariadb
|
# Environment files for docker composes
|
||||||
|
.env.production
|
||||||
|
|
||||||
|
# Home assistant configuration file
|
||||||
|
configuration.production.yaml
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
# Loads default set of integrations. Do not remove
|
# Loads default set of integrations. Do not remove
|
||||||
# This was added to the homeAutomation repo.
|
# This was added to the homeAutomation repo.
|
||||||
default_config:
|
# This is a sample configuration. Please create a configuration.production.yml for production use.
|
||||||
|
default_config:
|
||||||
# Text to speech
|
|
||||||
tts:
|
# Text to speech
|
||||||
- platform: google_translate
|
tts:
|
||||||
|
- platform: google_translate
|
||||||
automation: !include automations.yaml
|
|
||||||
script: !include scripts.yaml
|
automation: !include automations.yaml
|
||||||
scene: !include scenes.yaml
|
script: !include scripts.yaml
|
||||||
|
scene: !include scenes.yaml
|
||||||
http:
|
|
||||||
use_x_forwarded_for: true
|
http:
|
||||||
trusted_proxies:
|
use_x_forwarded_for: true
|
||||||
- 10.55.8.1
|
trusted_proxies:
|
||||||
|
- 10.55.8.1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# General settings
|
# General settings
|
||||||
INTERNAL_IP: localhost
|
INTERNAL_IP: 0.0.0.0
|
||||||
|
|
||||||
# Db-Specific settings
|
|
||||||
# Should be overridden with a .env.mariadb file.
|
|
||||||
MARIADB_ROOT_PASSWORD=test
|
|
||||||
MARIADB_USER=homeassistant
|
|
||||||
MARIADB_PASSWORD=homeassistant
|
|
||||||
|
|
||||||
|
# Maria DB settings
|
||||||
|
# For testing purposes only. Please create a .env.mariadb to overwrite these variables
|
||||||
|
MARIADB_ROOT_PASSWORD=testing
|
||||||
|
|
||||||
|
MARIADB_DATABASE=homeassistant
|
||||||
|
MARIADB_USER=homeassistant_user
|
||||||
|
MARIADB_PASSWORD=homeassistant_pw
|
||||||
|
|||||||
5
home-server/.env.mariadb
Normal file
5
home-server/.env.mariadb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
MARIADB_ROOT_PASSWORD=testing
|
||||||
|
|
||||||
|
MARIADB_DATABASE=homeassistant_2
|
||||||
|
MARIADB_USER=homeassistant_user
|
||||||
|
MARIADB_PASSWORD=homeassistant_pw
|
||||||
@@ -1,23 +1,26 @@
|
|||||||
version: "3.9"
|
version: "3.9"
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: mariadb
|
image: mariadb:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- ${INTERNAL_IP}:3306:3306
|
- 3306:3306
|
||||||
env_file:
|
env_file:
|
||||||
# Override the mariadb-specific settings in a .env.mariadb file.
|
|
||||||
# You should create the .env.mariadb file yourself.
|
|
||||||
- .env
|
- .env
|
||||||
- .env.mariadb
|
- .env.production
|
||||||
|
volumes:
|
||||||
|
- /home/willem/mariadb:/var/lib/mysql
|
||||||
homeassistant:
|
homeassistant:
|
||||||
image: "ghcr.io/home-assistant/home-assistant:stable"
|
image: "ghcr.io/home-assistant/home-assistant:stable"
|
||||||
ports:
|
ports:
|
||||||
- ${INTERNAL_IP}:8123:8123
|
- ${INTERNAL_IP}:8123:8123
|
||||||
volumes:
|
volumes:
|
||||||
- /home/willem/homeassistant:/config
|
- /home/willem/homeassistant:/config
|
||||||
- /home/willem/repos/homeAutomation/configurations/home-assistant/configuration.yaml:/config/configuration.yaml
|
- /home/willem/repos/homeAutomation/configurations/home-assistant/configuration.production.yaml:/config/configuration.yaml
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
- .env.production
|
||||||
syncthing:
|
syncthing:
|
||||||
image: lscr.io/linuxserver/syncthing:latest
|
image: lscr.io/linuxserver/syncthing:latest
|
||||||
container_name: syncthing
|
container_name: syncthing
|
||||||
|
|||||||
@@ -22,6 +22,14 @@ ln -s /usr/bin/resolvectl /usr/local/bin/resolvconf
|
|||||||
|
|
||||||
TODO add .sh script to start in production
|
TODO add .sh script to start in production
|
||||||
|
|
||||||
|
## Tips
|
||||||
|
|
||||||
|
When database credentials are not updated after docker restart, consider using
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose rm db
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## To Do
|
## To Do
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user