-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
executable file
·53 lines (48 loc) · 1.59 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
50
51
52
53
#!/bin/bash
set -e
# change the app uid to ones set from environment
if [ -n "${USER_UID}" ]; then
usermod -u $USER_UID application
fi
if [ -n "${USER_GID}" ]; then
groupmod -g $USER_GID application
fi
if [ ! -f /opt/rundir/config.ini ]; then
gosu application cp /opt/application/development.ini /opt/rundir/config.ini
fi
if ! [ -z "$CHANNELSTREAM_URL" ]
then
sourceVar="\/"
replacementVar="\/"
sed -i "s/channelstream.url.*/channelstream.url = ${CHANNELSTREAM_URL//$sourceVar/$replacementVar}/" /opt/rundir/config.ini
fi
if ! [ -z "$DEMO_URL" ]
then
sourceVar="\/"
replacementVar="\/"
sed -i "s/demo.url.*/demo.url = ${DEMO_URL//$sourceVar/$replacementVar}/" /opt/rundir/config.ini
fi
if ! [ -z "$CHANNELSTREAM_PUBLIC_URL" ]
then
sourceVar="\/"
replacementVar="\/"
sed -i "s/channelstream.public_url.*/channelstream.public_url = ${CHANNELSTREAM_PUBLIC_URL//$sourceVar/$replacementVar}/" /opt/rundir/config.ini
fi
if ! [ -z "$CHANNELSTREAM_WS_URL" ]
then
sourceVar="\/"
replacementVar="\/"
sed -i "s/channelstream.ws_url.*/channelstream.ws_url = ${CHANNELSTREAM_WS_URL//$sourceVar/$replacementVar}/" /opt/rundir/config.ini
fi
if ! [ -z "$CHANNELSTREAM_SECRET" ]
then
sourceVar="\/"
replacementVar="\/"
sed -i "s/channelstream.secret.*/channelstream.secret = ${CHANNELSTREAM_SECRET//$sourceVar/$replacementVar}/" /opt/rundir/config.ini
fi
if [ ! -f /opt/rundir/static_build/openapi.json ]; then
pushd /opt/rundir
gosu application channelstream_landing_build_statics config.ini --with-main-assets=0 --with-jsdoc=0
popd
fi;
gosu application "$@"