/
run_app.sh
44 lines (39 loc) · 937 Bytes
/
run_app.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
set -e
if [ -d /bundle ]; then
cd /bundle
tar xzf *.tar.gz
cd /bundle/bundle/programs/server/
npm i
cd /bundle/bundle/
elif [[ $BUNDLE_URL ]]; then
cd /tmp
curl -L -o bundle.tar.gz $BUNDLE_URL
tar xzf bundle.tar.gz
cd /tmp/bundle/programs/server/
npm i
cd /tmp/bundle/
elif [ -d /built_app ]; then
cd /built_app
else
echo "=> You don't have an meteor app to run in this image."
exit 1
fi
if [[ $REBULD_NPM_MODULES ]]; then
if [ -f /opt/meteord/rebuild_npm_modules.sh ]; then
cd programs/server
bash /opt/meteord/rebuild_npm_modules.sh
cd ../../
else
echo "=> Use meteorhacks/meteord:bin-build for binary bulding."
exit 1
fi
fi
# Set a delay to wait to start meteor container
if [[ $DELAY ]]; then
echo "Delaying startup for $DELAY seconds"
sleep $DELAY
fi
# Honour already existing PORT setup
export PORT=${PORT:-80}
echo "=> Starting meteor app on port:$PORT"
node main.js