forked from strapi/strapi-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrapi.sh
More file actions
executable file
·36 lines (27 loc) · 888 Bytes
/
strapi.sh
File metadata and controls
executable file
·36 lines (27 loc) · 888 Bytes
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
#!/bin/sh
set -ea
_stopStrapi() {
echo "Stopping strapi"
kill -SIGINT "$strapiPID"
wait "$strapiPID"
}
trap _stopStrapi SIGTERM SIGINT
cd /usr/src/api
APP_NAME=${APP_NAME:-strapi-app}
DATABASE_CLIENT=${DATABASE_CLIENT:-mongo}
DATABASE_HOST=${DATABASE_HOST:-localhost}
DATABASE_PORT=${DATABASE_PORT:-27017}
DATABASE_NAME=${DATABASE_NAME:-strapi}
if [ ! -f "$APP_NAME/package.json" ]
then
strapi new ${APP_NAME} --dbclient=$DATABASE_CLIENT --dbhost=$DATABASE_HOST --dbport=$DATABASE_PORT --dbname=$DATABASE_NAME --dbusername=$DATABASE_USERNAME --dbpassword=$DATABASE_PASSWORD
fi
cd $APP_NAME
#Fix Issue https://github.com/strapi/strapi/issues/679 added by xrb12xrb
npm install
npm install strapi@3.0.0-alpha.12.4 --save
npm install strapi-mongoose@3.0.0-alpha.12.4 --save
npm install strapi-bookshelf@3.0.0-alpha.12.4 --save
strapi start &
strapiPID=$!
wait "$strapiPID"