mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Restructured code and matrix rol
This commit is contained in:
26
templates/docker/services/mariadb.yml.j2
Normal file
26
templates/docker/services/mariadb.yml.j2
Normal file
@@ -0,0 +1,26 @@
|
||||
# This template needs to be included in docker-compose.yml, which depend on a mariadb database
|
||||
{% if not enable_central_database | bool %}
|
||||
database:
|
||||
container_name: {{docker_compose_project_name}}-database
|
||||
logging:
|
||||
driver: journald
|
||||
image: mariadb
|
||||
restart: {{docker_restart_policy}}
|
||||
environment:
|
||||
MYSQL_DATABASE: "{{database_name}}"
|
||||
MYSQL_USER: "{{database_username}}"
|
||||
MYSQL_PASSWORD: "{{database_password}}"
|
||||
MYSQL_ROOT_PASSWORD: "{{database_password}}"
|
||||
MARIADB_AUTO_UPGRADE: "1"
|
||||
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW"
|
||||
volumes:
|
||||
- database:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: "/usr/bin/mariadb --user={{database_username}} --password={{database_password}} --execute \"SHOW DATABASES;\""
|
||||
interval: 3s
|
||||
timeout: 1s
|
||||
retries: 5
|
||||
networks:
|
||||
- default
|
||||
{% endif %}
|
||||
{{ "\n" }}
|
24
templates/docker/services/postgres.yml.j2
Normal file
24
templates/docker/services/postgres.yml.j2
Normal file
@@ -0,0 +1,24 @@
|
||||
# This template needs to be included in docker-compose.yml, which depend on a postgres database
|
||||
{% if not enable_central_database | bool %}
|
||||
database:
|
||||
image: postgres:{{database_version}}-alpine
|
||||
container_name: {{docker_compose_project_name}}-database
|
||||
environment:
|
||||
- POSTGRES_PASSWORD={{database_password}}
|
||||
- POSTGRES_USER={{database_username}}
|
||||
- POSTGRES_DB={{database_name}}
|
||||
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale=C
|
||||
restart: {{docker_restart_policy}}
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U {{database_name}}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 6
|
||||
volumes:
|
||||
- type: volume
|
||||
source: database
|
||||
target: /var/lib/postgresql/data
|
||||
networks:
|
||||
- default
|
||||
{% endif %}
|
||||
{{ "\n" }}
|
17
templates/docker/services/redis.yml.j2
Normal file
17
templates/docker/services/redis.yml.j2
Normal file
@@ -0,0 +1,17 @@
|
||||
# This template needs to be included in docker-compose.yml, which depend on redis
|
||||
redis:
|
||||
image: redis:alpine
|
||||
container_name: {{docker_compose_project_name}}-redis
|
||||
restart: {{docker_restart_policy}}
|
||||
logging:
|
||||
driver: journald
|
||||
volumes:
|
||||
- redis:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 1s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
networks:
|
||||
- default
|
||||
{{ "\n" }}
|
Reference in New Issue
Block a user