tachybase_todo/docker/nocobase/docker-entrypoint.sh
sealday aab43d17d0 合并对main的所有修改
<!-- Note -->
<!-- This is a template for submitting a new feature.
Use the bug fix template if you're submitting a bug fix pull request by adding `template=bug_fix.md` to your pull request URL. -->

# Description
<!-- Describe the new feature or modification to an existing feature clearly and consciously. -->

# Motivation
<!-- Explain the reason for adding or modifying this feature. -->

# Key changes
<!-- Provide a technically detailed description of the key changes made. -->
- Frontend
- Backend

# Test plan
## Suggestions
<!-- Provide any suggestions or recommendations for improvements in the testing plan. -->

## Underlying risk
<!-- Identify any potential risks or issues that may arise from the new feature or modification. -->

# Showcase
<!-- Including any screenshots of the new feature or modification. -->

Co-authored-by: sealday <sealday@gmail.com>
Co-authored-by: wjh <wwwjh0710@163.com>
Co-authored-by: 吕延祥 <2256334253@qq.com>
Reviewed-on: daoyoucloud/nocobase#317
2024-03-07 20:45:00 +08:00

31 lines
810 B
Bash
Executable File

#!/bin/sh
set -e
nginx
echo 'nginx started';
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
touch /app/nocobase/node_modules/@nocobase/app/dist/client/index.html
fi
if [ -z "$PM2_INSTANCE_NUM" ]; then
PM2_INSTANCE_NUM=1
fi
cd /app/nocobase && yarn start --quickstart -i $PM2_INSTANCE_NUM
# 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 "$@"