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,5 +1,6 @@
|
||||
# Loads default set of integrations. Do not remove
|
||||
# This was added to the homeAutomation repo.
|
||||
# This is a sample configuration. Please create a configuration.production.yml for production use.
|
||||
default_config:
|
||||
|
||||
# Text to speech
|
||||
@@ -14,3 +15,6 @@ http:
|
||||
use_x_forwarded_for: true
|
||||
trusted_proxies:
|
||||
- 10.55.8.1
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# General settings
|
||||
INTERNAL_IP: localhost
|
||||
|
||||
# Db-Specific settings
|
||||
# Should be overridden with a .env.mariadb file.
|
||||
MARIADB_ROOT_PASSWORD=test
|
||||
MARIADB_USER=homeassistant
|
||||
MARIADB_PASSWORD=homeassistant
|
||||
INTERNAL_IP: 0.0.0.0
|
||||
|
||||
# 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"
|
||||
services:
|
||||
db:
|
||||
image: mariadb
|
||||
image: mariadb:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- ${INTERNAL_IP}:3306:3306
|
||||
- 3306:3306
|
||||
env_file:
|
||||
# Override the mariadb-specific settings in a .env.mariadb file.
|
||||
# You should create the .env.mariadb file yourself.
|
||||
- .env
|
||||
- .env.mariadb
|
||||
- .env.production
|
||||
volumes:
|
||||
- /home/willem/mariadb:/var/lib/mysql
|
||||
homeassistant:
|
||||
image: "ghcr.io/home-assistant/home-assistant:stable"
|
||||
ports:
|
||||
- ${INTERNAL_IP}:8123:8123
|
||||
volumes:
|
||||
- /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
|
||||
env_file:
|
||||
- .env
|
||||
- .env.production
|
||||
syncthing:
|
||||
image: lscr.io/linuxserver/syncthing:latest
|
||||
container_name: syncthing
|
||||
|
||||
@@ -22,6 +22,14 @@ ln -s /usr/bin/resolvectl /usr/local/bin/resolvconf
|
||||
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user