2020-05-26 17:30:37 +02:00
|
|
|
#!/bin/sh
|
2020-12-22 00:41:01 +01:00
|
|
|
set -e
|
2020-04-09 22:33:27 +02:00
|
|
|
|
|
|
|
cd /app
|
2021-02-24 21:45:25 +01:00
|
|
|
export MONGO_OPLOG_URL=mongodb://10.7.7.6/local
|
2020-04-09 22:33:27 +02:00
|
|
|
export MONGO_URL=mongodb://10.7.7.6/meteor
|
2021-02-24 21:50:27 +01:00
|
|
|
export ROOT_URL=http://127.0.0.1/html5client
|
2020-04-09 22:33:27 +02:00
|
|
|
export NODE_ENV=production
|
2020-12-22 00:41:01 +01:00
|
|
|
export SERVER_WEBSOCKET_COMPRESSION=0
|
2020-12-23 23:58:24 +01:00
|
|
|
export BIND_IP=0.0.0.0
|
2020-06-06 20:13:28 +02:00
|
|
|
export LANG=en_US.UTF-8
|
2020-12-23 23:58:24 +01:00
|
|
|
export INSTANCE_MAX=1
|
2021-02-11 14:34:55 +01:00
|
|
|
export ENVIRONMENT_TYPE=production
|
|
|
|
export NODE_VERSION=node-v12.16.1-linux-x64
|
2020-04-09 22:33:27 +02:00
|
|
|
|
2020-07-22 00:39:28 +02:00
|
|
|
if [ "$DEV_MODE" == true ]; then
|
|
|
|
echo "DEV_MODE=true, disable TLS certificate rejecting"
|
|
|
|
export NODE_TLS_REJECT_UNAUTHORIZED=0
|
|
|
|
fi
|
|
|
|
|
2021-02-24 21:50:27 +01:00
|
|
|
if [ "$BBB_HTML5_ROLE" == "backend" ]; then
|
|
|
|
PARAM=NODEJS_BACKEND_INSTANCE_ID=$INSTANCE_ID
|
2020-12-22 00:41:01 +01:00
|
|
|
fi
|
|
|
|
|
2020-12-23 23:58:24 +01:00
|
|
|
|
2021-02-24 21:50:27 +01:00
|
|
|
# if container is the first frontend, do some additional tasks
|
|
|
|
if [ "$BBB_HTML5_ROLE" == "frontend" ] && [ "$INSTANCE_ID" == "1" ]; then
|
|
|
|
# delete potential old settings.yml
|
2020-12-23 23:58:24 +01:00
|
|
|
|
2021-02-24 21:50:27 +01:00
|
|
|
# copy static files into volume for direct access by nginx
|
|
|
|
# https://github.com/bigbluebutton/bigbluebutton/issues/10739
|
|
|
|
if [ -d "/html5-static" ]; then
|
|
|
|
rm -rf /html5-static/*
|
|
|
|
cp -r /app/programs/web.browser/* /html5-static
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
2020-12-23 23:58:24 +01:00
|
|
|
|
2020-05-26 17:30:37 +02:00
|
|
|
rm -f /app/programs/server/assets/app/config/settings.yml
|
2020-04-10 13:29:06 +02:00
|
|
|
dockerize \
|
|
|
|
-template /app/programs/server/assets/app/config/settings.yml.tmpl:/app/programs/server/assets/app/config/settings.yml \
|
2021-02-24 21:50:27 +01:00
|
|
|
su-exec meteor \
|
|
|
|
node --max-old-space-size=2048 --max_semi_space_size=128 main.js $PARAM
|