diff --git a/ansible/files/postgrest-optimizations.service.j2 b/ansible/files/postgrest-optimizations.service.j2 index 38604b67a8..e481785e6b 100644 --- a/ansible/files/postgrest-optimizations.service.j2 +++ b/ansible/files/postgrest-optimizations.service.j2 @@ -4,7 +4,7 @@ Description=Postgrest optimizations [Service] Type=oneshot # we don't want failures from this command to cause PG startup to fail -ExecStart=/bin/bash -c "/opt/supabase-admin-api optimize postgrest --destination-config-file-path /etc/postgrest/generated.conf ; exit 0" +ExecStart=/bin/bash -c "/opt/supabase-admin-api optimize postgrest --destination-config-file-path /etc/postgrest/generated.conf --destination-env-file-path /etc/postgrest/generated.env; exit 0" User=postgrest [Install] diff --git a/ansible/files/postgrest.service.j2 b/ansible/files/postgrest.service.j2 index 61102cb429..b47ab8e944 100644 --- a/ansible/files/postgrest.service.j2 +++ b/ansible/files/postgrest.service.j2 @@ -8,6 +8,7 @@ StartLimitBurst=0 [Service] Type=simple +EnvironmentFile=-/etc/postgrest/generated.env # We allow the base config (sent from the worker) to override the generated config ExecStartPre=/etc/postgrest/merge.sh /etc/postgrest/generated.conf /etc/postgrest/base.conf ExecStart=/opt/postgrest /etc/postgrest/merged.conf