Skip to content

Commit 6ffdf0a

Browse files
committed
Make apt installs async by default
1 parent e471807 commit 6ffdf0a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

docker-entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
# Run last-minute package installs
44
if [ -n "$SB_APT_PACKAGES" ]; then
55
if [ "$UID" == "0" ]; then
6-
apt update -y
7-
apt install -y $SB_APT_PACKAGES
6+
if [ -n "$SB_APT_SYNC" ]; then
7+
apt update -y
8+
apt install -y $SB_APT_PACKAGES
9+
else
10+
(apt update -y && apt install -y $SB_APT_PACKAGES) &
11+
fi
812
else
913
echo "Cannot install packages selected via SB_APT_PACKAGES unless run as root"
1014
fi

website/Install/Configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ SilverBullet is primarily configured via environment variables. This page gives
77

88
# Network
99
* `SB_HOSTNAME`: Set to the hostname to bind to (defaults to `127.0.0.0`, set to `0.0.0.0` to accept outside connections for the local deno setup, defaults to `0.0.0.0` for docker)
10-
* `SB_PORT`: Sets the port to listen to, e.g. `SB_PORT=1234`, default is `3000`
11-
* `SB_URL_PREFIX`: Host SilverBullet on a particular URL prefix, e.g. `SB_URL_PREFIX=/notes`
10+
* `SB_PORT`: Sets the port to listen to, e.g. `SB_PORT=1234`, default is `3000` * `SB_URL_PREFIX`: Host SilverBullet on a particular URL prefix, e.g. `SB_URL_PREFIX=/notes`
1211

1312
# Authentication
1413
SilverBullet supports basic authentication for a single user.
@@ -41,7 +40,8 @@ Configuration only relevant to docker deployments:
4140
* `PUID`: Runs the server process with the specified UID (default: whatever user owns the `/space` mapped folder)
4241
* `GUID`: Runs the server process with the specified GID (default: whatever group owns the `/space` mapped folder)\
4342
* `SB_APT_PACKAGES`: will install additional (ubuntu) packages inside the container upon boot. Example: `SB_APT_PACKAGES="ripgrep pandoc"`
44-
**Warning:** this will (probably) significantly increase the boot time of your container.
43+
**Note:** This installation happens asynchronously in the background (you can see it happen in the server output) unless `SB_APT_SYNC` is set (see bellow)
44+
* `SB_APT_SYNC`: when set, will _first_ install APT packages configured with `SB_APT_PACKAGES` before booting SilverBullet itself.
4545

4646
# Web app manifest
4747
Configure aspects of web app appearance:

0 commit comments

Comments
 (0)