forked from temporalio/docker-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·53 lines (43 loc) · 1.47 KB
/
entrypoint.sh
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
set -eu -o pipefail
: "${BIND_ON_IP:=$(getent hosts "$(hostname)" | awk '{print $1;}')}"
export BIND_ON_IP
# check TEMPORAL_ADDRESS is not empty
if [[ -z "${TEMPORAL_ADDRESS:-}" ]]; then
echo "TEMPORAL_ADDRESS is not set, setting it to ${BIND_ON_IP}:7233"
if [[ "${BIND_ON_IP}" =~ ":" ]]; then
# ipv6
export TEMPORAL_ADDRESS="[${BIND_ON_IP}]:7233"
else
# ipv4
export TEMPORAL_ADDRESS="${BIND_ON_IP}:7233"
fi
fi
# Support TEMPORAL_CLI_ADDRESS for backwards compatibility.
# TEMPORAL_CLI_ADDRESS is deprecated and support for it will be removed in the future release.
if [[ -z "${TEMPORAL_CLI_ADDRESS:-}" ]]; then
export TEMPORAL_CLI_ADDRESS="${TEMPORAL_ADDRESS}"
fi
dockerize -template /etc/temporal/config/config_template.yaml:/etc/temporal/config/docker.yaml
# Automatically setup Temporal Server (databases, Elasticsearch, default namespace) if "autosetup" is passed as an argument.
for arg; do
if [[ ${arg} == autosetup ]]; then
/etc/temporal/auto-setup.sh
break
fi
done
# Setup Temporal Server in development mode if "develop" is passed as an argument.
for arg; do
if [[ ${arg} == develop ]]; then
/etc/temporal/setup-develop.sh
break
fi
done
# Run bash instead of Temporal Server if "bash" is passed as an argument (convenient to debug docker image).
for arg; do
if [[ ${arg} == bash ]]; then
bash
exit 0
fi
done
exec /etc/temporal/start-temporal.sh