Skip to content

Commit

Permalink
Prevent start_for_complement.sh from setting START_POSTGRES to `f…
Browse files Browse the repository at this point in the history
…alse` when it's already set (#16985)

I have a use case where I'd like the Synapse image to start up a
postgres instance that I can use, but don't want to force Synapse to use
postgres as well.

This commit prevents postgres from being started when it has already
been explicitly enabled elsewhere.
  • Loading branch information
anoadragon453 authored Mar 21, 2024
1 parent cf5adc8 commit 21daa56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/16985.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow containers building on top of Synapse's Complement container is use the included PostgreSQL cluster.
2 changes: 1 addition & 1 deletion docker/complement/conf/postgres.supervisord.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[program:postgres]
command=/usr/local/bin/prefix-log gosu postgres postgres

# Only start if START_POSTGRES=1
# Only start if START_POSTGRES=true
autostart=%(ENV_START_POSTGRES)s

# Lower priority number = starts first
Expand Down
5 changes: 3 additions & 2 deletions docker/complement/conf/start_for_complement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ case "$SYNAPSE_COMPLEMENT_DATABASE" in
;;

sqlite|"")
# Configure supervisord not to start Postgres, as we don't need it
export START_POSTGRES=false
# Set START_POSTGRES to false unless it has already been set
# (i.e. by another container image inheriting our own).
export START_POSTGRES=${START_POSTGRES:-false}
;;

*)
Expand Down

0 comments on commit 21daa56

Please sign in to comment.