From 94a31d41c1a56a15ae5d495c9c0a0a16f4966c4a Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 4 Dec 2022 20:21:28 +0100 Subject: [PATCH] Fix Mastodon deployment errors First-time deployment fails, because postgresql.conf is in the database data directory, and the directory must be empty the first time the database is created. --- roles/docker/tasks/services/mastodon.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/docker/tasks/services/mastodon.yml b/roles/docker/tasks/services/mastodon.yml index 19b74ef..472ea95 100644 --- a/roles/docker/tasks/services/mastodon.yml +++ b/roles/docker/tasks/services/mastodon.yml @@ -6,6 +6,7 @@ group: "991" loop: - "postgres_data" + - "postgres_config" - "redis_data" - "mastodon_data" loop_control: @@ -21,10 +22,10 @@ src: files/configs/mastodon/vhost-mastodon dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.mastodon.domain }}" -- name: Copy postgresql config +- name: Copy PostgreSQL config copy: src: files/configs/mastodon/postgresql.conf - dest: "{{ services.mastodon.volume_folder }}/postgres_data/postgresql.conf" + dest: "{{ services.mastodon.volume_folder }}/postgres_config/postgresql.conf" - name: Set up Mastodon docker_compose: @@ -62,6 +63,8 @@ test: ['CMD', 'pg_isready', '-U', 'postgres'] volumes: - "{{ services.mastodon.volume_folder }}/postgres_data:/var/lib/postgresql/data" + - "{{ services.mastodon.volume_folder }}/postgres_config:/config:ro" + command: postgres -c config_file=/config/postgresql.conf environment: - 'POSTGRES_HOST_AUTH_METHOD=trust'