mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
Optimize/docker container (#5800)
* Bumped ueberdb2 to 4.1.1 * Install only production ready dependencies. * Added optimized Dockerfile. * Fixed variable detection. * Move to own variable for detecting production build. * Use shell syntax for parameter expansion. * Use shell as default.
This commit is contained in:
parent
8ab82d713d
commit
9a679aca56
2 changed files with 18 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
|
||||
# Move to the Etherpad base directory.
|
||||
MY_DIR=$(cd "${0%/*}" && pwd -P) || exit 1
|
||||
cd "${MY_DIR}/../.." || exit 1
|
||||
|
@ -36,14 +37,22 @@ if [ ! -f "$settings" ]; then
|
|||
cp settings.json.template "$settings" || exit 1
|
||||
fi
|
||||
|
||||
|
||||
log "Installing dependencies..."
|
||||
(
|
||||
mkdir -p node_modules &&
|
||||
cd node_modules &&
|
||||
{ [ -d ep_etherpad-lite ] || ln -sf ../src ep_etherpad-lite; } &&
|
||||
cd ep_etherpad-lite &&
|
||||
npm ci --no-optional --omit=optional --include=dev --lockfile-version 1
|
||||
) || exit 1
|
||||
(mkdir -p node_modules &&
|
||||
cd node_modules &&
|
||||
{ [ -d ep_etherpad-lite ] || ln -sf ../src ep_etherpad-lite; } &&
|
||||
cd ep_etherpad-lite)
|
||||
|
||||
cd src
|
||||
|
||||
if [ -z "${ETHERPAD_PRODUCTION}" ]; then
|
||||
log "Installing dev dependencies"
|
||||
npm ci --no-optional --omit=optional --include=dev --lockfile-version 1 || exit 1
|
||||
else
|
||||
log "Installing production dependencies"
|
||||
npm ci --no-optional --omit=optional --omit=dev --lockfile-version 1 --production || exit 1
|
||||
fi
|
||||
|
||||
# Remove all minified data to force node creating it new
|
||||
log "Clearing minified cache..."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue