-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
27 lines (24 loc) · 1.24 KB
/
entrypoint.sh
File metadata and controls
27 lines (24 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# Build NUQ_RABBITMQ_URL and PLAYWRIGHT_MICROSERVICE_URL from the *_HOST
# values the Blueprint provides via fromService.host. Both upstream env
# vars expect fully-qualified URLs with scheme prefixes, which render.yaml
# can't construct directly.
#
# Why we hardcode the ports here instead of using fromService.hostport:
# Render's pserv port-detection picks whichever port HTTP-responds first
# inside the container. The rabbitmq:3-management image opens five ports
# (5672 AMQP, 15672 mgmt UI, 15692 prometheus, 25672 erldist, 4369 epmd)
# and Render lands on 15672 — the management HTTP UI, not AMQP. The
# Playwright image opens 3000 but multi-process variants can confuse the
# scanner. Hardcoding the well-known ports here is robust because they
# are baked into the upstream images.
set -eu
if [ -n "${NUQ_RABBITMQ_HOST:-}" ] && [ -z "${NUQ_RABBITMQ_URL:-}" ]; then
export NUQ_RABBITMQ_URL="amqp://${NUQ_RABBITMQ_HOST}:5672"
echo "entrypoint: NUQ_RABBITMQ_URL=${NUQ_RABBITMQ_URL}"
fi
if [ -n "${PLAYWRIGHT_HOST:-}" ] && [ -z "${PLAYWRIGHT_MICROSERVICE_URL:-}" ]; then
export PLAYWRIGHT_MICROSERVICE_URL="http://${PLAYWRIGHT_HOST}:3000/scrape"
echo "entrypoint: PLAYWRIGHT_MICROSERVICE_URL=${PLAYWRIGHT_MICROSERVICE_URL}"
fi
exec "$@"