yapi-docker/start.sh

30 lines
783 B
Bash
Raw Normal View History

2021-05-22 13:47:14 +00:00
#!/usr/bin/env sh
cd ${YAPI_HOME}/vendors
if [ ! -e "init.lock" ]
then
sed -i "s/YAPI_PORT/${YAPI_PORT}/g" config.json
sed -i "s/ADMIN_EMAIL/${ADMIN_EMAIL}/g" config.json
sed -i "s/DB_HOST/${DB_HOST}/g" config.json
sed -i "s/DB_NAME/${DB_NAME}/g" config.json
sed -i "s/DB_PORT/${DB_PORT}/g" config.json
sed -i "s/\"MAIL_ENABLE\"/${MAIL_ENABLE}/g" config.json
sed -i "s/MAIL_HOST/${MAIL_HOST}/g" config.json
sed -i "s/MAIL_PORT/${MAIL_PORT}/g" config.json
sed -i "s/MAIL_FROM/${MAIL_FROM}/g" config.json
sed -i "s/MAIL_USER/${MAIL_USER}/g" config.json
sed -i "s/MAIL_PWD/${MAIL_PWD}/g" config.json
# yapi install -v ${YAPI_VERSION}
npm run install-server
touch init.lock
fi
cd ${YAPI_HOME}/vendors
if [ $1 ]
then
node $i
else
node server/app.js
fi