mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Added draft for central postgres and mariadb. variables and networks still need to be adapted
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
loop_control:
|
||||
loop_var: domain
|
||||
|
||||
- name: create database in central Postgres
|
||||
include_role:
|
||||
name: docker-postgres
|
||||
when: enable_central_database | bool
|
||||
|
||||
- name: "create {{docker_compose_instance_directory}}"
|
||||
file:
|
||||
path: "{{docker_compose_instance_directory}}"
|
||||
|
@@ -1,19 +1,5 @@
|
||||
version: '3'
|
||||
services:
|
||||
database:
|
||||
restart: always
|
||||
image: postgres:14-alpine
|
||||
shm_size: 256mb
|
||||
networks:
|
||||
- internal_network
|
||||
healthcheck:
|
||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
||||
volumes:
|
||||
- database:/var/lib/postgresql/data
|
||||
environment:
|
||||
- 'POSTGRES_HOST_AUTH_METHOD=trust'
|
||||
logging:
|
||||
driver: journald
|
||||
|
||||
{% include 'templates/docker-redis-service.yml.j2' %}
|
||||
|
||||
@@ -34,7 +20,9 @@ services:
|
||||
ports:
|
||||
- "127.0.0.1:{{http_port}}:3000"
|
||||
depends_on:
|
||||
{% if not ( enable_central_database | lower | bool ) %}
|
||||
- database
|
||||
{% endif %}
|
||||
- redis
|
||||
volumes:
|
||||
- data:/mastodon/public/system
|
||||
@@ -54,7 +42,9 @@ services:
|
||||
ports:
|
||||
- "127.0.0.1:{{stream_port}}:4000"
|
||||
depends_on:
|
||||
{% if not ( enable_central_database | lower | bool ) %}
|
||||
- database
|
||||
{% endif %}
|
||||
- redis
|
||||
logging:
|
||||
driver: journald
|
||||
@@ -64,7 +54,9 @@ services:
|
||||
env_file: .env.production
|
||||
command: bundle exec sidekiq
|
||||
depends_on:
|
||||
{% if not ( enable_central_database | lower | bool ) %}
|
||||
- database
|
||||
{% endif %}
|
||||
- redis
|
||||
networks:
|
||||
- external_network
|
||||
@@ -75,8 +67,14 @@ services:
|
||||
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]
|
||||
logging:
|
||||
driver: journald
|
||||
{% if not ( enable_central_database | lower | bool ) %}
|
||||
{% include 'templates/docker-postgres-service.yml.j2' %}
|
||||
{% endif %}
|
||||
|
||||
volumes:
|
||||
{% if not ( enable_central_database | lower | bool ) %}
|
||||
database:
|
||||
{% endif %}
|
||||
redis:
|
||||
data:
|
||||
networks:
|
||||
|
@@ -1,6 +1,7 @@
|
||||
docker_compose_project_name: "mastodon"
|
||||
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
|
||||
database_host: "database"
|
||||
database_databasename: "postgres" # todo: Change this to standart name scheme for future setups
|
||||
database_username: "postgres" # todo: Change this to standart name scheme for future setups
|
||||
database_password: "" # todo: Change this to standart name scheme for future setups
|
||||
database_databasename: "{{docker_compose_project_name}}"
|
||||
database_username: "{{docker_compose_project_name}}"
|
||||
database_password: "{{mastodon_database_password}}"
|
||||
database_version: "{{ mastodon_database_version | default(postgres_default_version) }}"
|
Reference in New Issue
Block a user