mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-02 20:36:49 +01:00
Update startup scripts (see below)
1. Set NODE_ENV to production and skip dev dependencies when running from scripts. 2. Remove pkg leftovers. Indicate current environment instead.
This commit is contained in:
parent
8be17251fe
commit
a7aa5fccf9
@ -12,11 +12,14 @@ ENTRYPOINT [ "tini", "--" ]
|
|||||||
# Create app directory
|
# Create app directory
|
||||||
WORKDIR ${APP_HOME}
|
WORKDIR ${APP_HOME}
|
||||||
|
|
||||||
|
# Set NODE_ENV to production
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
# Install app dependencies
|
# Install app dependencies
|
||||||
COPY package*.json post-install.js ./
|
COPY package*.json post-install.js ./
|
||||||
RUN \
|
RUN \
|
||||||
echo "*** Install npm packages ***" && \
|
echo "*** Install npm packages ***" && \
|
||||||
npm install && npm cache clean --force
|
npm i --no-audit --no-fund --quiet --omit=dev && npm cache clean --force
|
||||||
|
|
||||||
# Bundle app source
|
# Bundle app source
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
pushd %~dp0
|
pushd %~dp0
|
||||||
call npm install --no-audit
|
set NODE_ENV=production
|
||||||
|
call npm install --no-audit --no-fund --quiet --omit=dev
|
||||||
node server.js %*
|
node server.js %*
|
||||||
pause
|
pause
|
||||||
popd
|
popd
|
||||||
|
@ -11,7 +11,8 @@ if %errorlevel% neq 0 (
|
|||||||
echo There were errors while updating. Please download the latest version manually.
|
echo There were errors while updating. Please download the latest version manually.
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
call npm install
|
set NODE_ENV=production
|
||||||
|
call npm install --no-audit --no-fund --quiet --omit=dev
|
||||||
node server.js %*
|
node server.js %*
|
||||||
pause
|
pause
|
||||||
popd
|
popd
|
||||||
|
@ -93,8 +93,8 @@ const cliArguments = yargs(hideBin(process.argv))
|
|||||||
}).parseSync();
|
}).parseSync();
|
||||||
|
|
||||||
// change all relative paths
|
// change all relative paths
|
||||||
const serverDirectory = process['pkg'] ? path.dirname(process.execPath) : __dirname;
|
console.log(`Running in ${process.env.NODE_ENV} environment`);
|
||||||
console.log(process['pkg'] ? 'Running from binary' : 'Running from source');
|
const serverDirectory = __dirname;
|
||||||
process.chdir(serverDirectory);
|
process.chdir(serverDirectory);
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
3
start.sh
3
start.sh
@ -28,7 +28,8 @@ if [ ! -z "$REPL_ID" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing Node Modules..."
|
echo "Installing Node Modules..."
|
||||||
npm i --no-audit
|
export NODE_ENV=production
|
||||||
|
npm i --no-audit --no-fund --quiet --omit=dev
|
||||||
|
|
||||||
echo "Entering SillyTavern..."
|
echo "Entering SillyTavern..."
|
||||||
node "$(dirname "$0")/server.js" "$@"
|
node "$(dirname "$0")/server.js" "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user