Skip to content

Commit b453459

Browse files
committed
fix: Export env vars before docker-compose in deploy script
Problem: docker-compose substitutes ${VAR} from shell environment, but env variables from secrets/*.env files were not exported. This caused RabbitMQ RABBITMQ_DEFAULT_USER/PASS to be empty, resulting in auth failures. Solution: Use 'set -a' to auto-export all variables, source env files, then 'set +a' before running docker-compose commands. This fixes RabbitMQ authentication errors in production worker.
1 parent 1f3a173 commit b453459

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

deploy-production.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ echo "✓ Code updated"
3737
echo ""
3838
3939
echo "🐳 Pulling latest Docker images..."
40+
set -a # automatically export all variables
41+
source secrets/azure.env
42+
source secrets/cloudflare.env 2>/dev/null || true
43+
source secrets/users.env 2>/dev/null || true
44+
source secrets/sendgrid.env 2>/dev/null || true
45+
set +a # stop auto-export
4046
docker-compose -f docker/docker-compose.prod.yml pull
4147
echo "✓ Images pulled"
4248
echo ""

0 commit comments

Comments
 (0)