2022-07-08 11:02:33 +08:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ ! -d "/app/nocobase" ]; then
|
|
|
|
mkdir nocobase
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "/app/nocobase/package.json" ]; then
|
|
|
|
echo 'copying...'
|
|
|
|
tar -zxf /app/nocobase.tar.gz --absolute-names -C /app/nocobase
|
2023-08-02 11:25:11 +08:00
|
|
|
touch /app/nocobase/node_modules/@nocobase/app/dist/client/index.html
|
2022-07-08 11:02:33 +08:00
|
|
|
fi
|
|
|
|
|
2024-03-16 20:01:34 +08:00
|
|
|
cd /app/nocobase && yarn nocobase create-nginx-conf
|
|
|
|
rm -rf /etc/nginx/sites-enabled/nocobase.conf
|
|
|
|
ln -s /app/nocobase/storage/nocobase.conf /etc/nginx/sites-enabled/nocobase.conf
|
|
|
|
|
|
|
|
nginx
|
|
|
|
echo 'nginx started';
|
|
|
|
|
2022-12-05 22:19:22 +08:00
|
|
|
cd /app/nocobase && yarn start --quickstart
|
2022-07-08 11:02:33 +08:00
|
|
|
|
|
|
|
# Run command with node if the first argument contains a "-" or is not a system command. The last
|
|
|
|
# part inside the "{}" is a workaround for the following bug in ash/dash:
|
|
|
|
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
|
|
|
|
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
|
|
|
|
set -- node "$@"
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec "$@"
|