Added seperat redis

This commit is contained in:
2024-01-05 20:16:08 +01:00
parent 6836ceebdd
commit cda6f1a8dc
9 changed files with 51 additions and 37 deletions

View File

@@ -4,5 +4,5 @@ networks:
central_{{ database_type }}_network:
external: true
{% endif %}
{{docker_compose_project_name}}_network:
default_network:
{{ "\n" }}

View File

@@ -1,6 +1,6 @@
# This template needs to be included in docker-compose.yml containers
networks:
{{docker_compose_project_name}}_network:
default_network:
{% if enable_central_database | bool %}
central_{{ database_type }}_network:
{% endif %}

View File

@@ -1,6 +1,7 @@
# 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}}-mariadb
logging:
driver: journald
image: mariadb
@@ -20,6 +21,6 @@
timeout: 1s
retries: 5
networks:
- {{docker_compose_project_name}}_network
- default_network
{% endif %}
{{ "\n" }}

View File

@@ -2,6 +2,7 @@
{% if not enable_central_database | bool %}
database:
image: postgres:{{database_version}}-alpine
container_name: {{docker_compose_project_name}}-postgres
environment:
- POSTGRES_PASSWORD={{database_password}}
- POSTGRES_USER={{database_username}}
@@ -18,6 +19,6 @@
source: database
target: /var/lib/postgresql/data
networks:
- {{docker_compose_project_name}}_network
- default_network
{% endif %}
{{ "\n" }}

View File

@@ -1,6 +1,7 @@
# 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: always
logging:
driver: journald
@@ -12,5 +13,5 @@
timeout: 3s
retries: 30
networks:
- {{docker_compose_project_name}}_network
- default_network
{{ "\n" }}