-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
49 lines (37 loc) · 1.65 KB
/
docker-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
#!/bin/bash
set -e
echo "Updating settings.js on $(date)";
if [ -z ${NODE_ENV+x} ]
then echo "Environment variable NODE_ENV is required, but it is not set. Exiting."; exit 1;
fi
if [ -z ${INDABA_CLIENT_URL+x} ]
then echo "Environment variable INDABA_CLIENT_URL is required, but it is not set. Exiting."; exit 1;
fi
if [ -z ${GREYSCALE_URL+x} ]
then echo "Environment variable GREYSCALE_URL is required, but it is not set. Exiting."; exit 1;
fi
if [ -z ${AUTH_MICROSERVICE_URL+x} ]
then echo "Environment variable AUTH_MICROSERVICE_URL is required, but it is not set. Exiting."; exit 1;
fi
if [ -z ${SURVEY_MICROSERVICE_URL+x} ]
then echo "Environment variable SURVEY_MICROSERVICE_URL is required, but it is not set. Exiting."; exit 1;
fi
if [ -z ${MESSAGING_MICROSERVICE_URL+x} ]
then echo "Environment variable MESSAGING_MICROSERVICE_URL is required, but it is not set. Exiting."; exit 1;
fi
if [ -z ${INDABA_CLIENT_DEFAULT_REALM+x} ]
then echo "Environment variable INDABA_CLIENT_DEFAULT_REALM is required, but it is not set. Exiting."; exit 1;
fi
if [ -z ${SYS_MESSAGE_USER+x} ]
then echo "Environment variable SYS_MESSAGE_USER is required, but it is not set. Exiting."; exit 1;
fi
SET_CONFIG="NODE_ENV=\"$NODE_ENV\";\n
INDABA_CLIENT_URL=\"$INDABA_CLIENT_URL\";\n
GREYSCALE_URL=\"$GREYSCALE_URL\";\n
AUTH_MICROSERVICE_URL=\"$AUTH_MICROSERVICE_URL\";\n
SURVEY_MICROSERVICE_URL=\"$SURVEY_MICROSERVICE_URL\";\n
MESSAGING_MICROSERVICE_URL=\"$MESSAGING_MICROSERVICE_URL\";\n
INDABA_CLIENT_DEFAULT_REALM=\"$INDABA_CLIENT_DEFAULT_REALM\";\n
SYS_MESSAGE_USER=\"$SYS_MESSAGE_USER\";\n"
echo -e $SET_CONFIG >> /usr/share/nginx/html/settings.js
nginx -g 'daemon off;'