add rabbitmq entrypoint, fix config permission

This commit is contained in:
brooke 2025-02-12 19:28:21 -05:00
parent 5c8d7f02ad
commit 2d105e47a2
2 changed files with 25 additions and 6 deletions

View File

@ -8,7 +8,7 @@ services:
configs:
- source: entrypoint
target: /custom-entrypoint.sh
mode: 555
mode: 0555
entrypoint: /custom-entrypoint.sh
environment:
DB_HOST: "database"
@ -61,7 +61,7 @@ services:
configs:
- source: pg_backup
target: /pg_backup.sh
mode: 555
mode: 0555
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 10s
@ -81,7 +81,7 @@ services:
configs:
- source: memcached_entrypoint
target: /custom-entrypoint.sh
mode: 555
mode: 0555
entrypoint: /custom-entrypoint.sh
secrets:
- memcached_password
@ -95,11 +95,13 @@ services:
image: "rabbitmq:4.0.6"
environment:
RABBITMQ_DEFAULT_USER: "zulip"
RABBITMQ_DEFAULT_PASS_FILE: "/run/secrets/rabbitmq_password"
configs:
- source: rabbitmq_healthcheck
target: /healthcheck.sh
mode: 555
mode: 0555
- source: rabbitmq_entrypoint
target: /custom-entrypoint.sh
mode: 0555
secrets:
- rabbitmq_password
volumes:
@ -117,7 +119,7 @@ services:
configs:
- source: redis_entrypoint
target: /custom-entrypoint.sh
mode: 555
mode: 0555
entrypoint: /custom-entrypoint.sh
secrets:
- redis_password

View File

@ -0,0 +1,17 @@
#!/bin/sh
if [ -f /run/secrets/memcached_password ]; then
export MEMCACHED_PASSWORD=$(cat /run/secrets/memcached_password)
else
echo "Membcached password secret not found, skipping."
fi
set -e
# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- memcached "$@"
fi
exec "$@"