Refresh deploy/ and bin/ from the boilerplate at 09e144d (the release split between the distro and Windows, wsl-setup, the server config, USER 1000, python:3.15-slim) with roledesk's facts put back: no frontend stage, desk, plugins and seed copied, the extras passkeys, embeddings and llm, roles as the table the backup and the importer require, bin/pull.sh and bin/worker.sh with their profile commands, and Install Server.md and Install WSL.md as copies in place of the five old deployment docs
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
83e965dfeb
commit
a1f281a23a
40 files changed
+2226
-1287
No files matched your search
+27
-10
@@ -1,9 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run on the server, next to the compose file, or with its directory as $1.
|
||||
# No remote shell required: the release scripts on Windows publish an image
|
||||
# No remote shell required: the release scripts publish an image
|
||||
# and stop there, and this is the other half.
|
||||
#
|
||||
# Rename `app` and `APP_DATA` to your service's name.
|
||||
# SERVICE is the compose service, the one name a project renames in these
|
||||
# scripts (README, "Starting a project from it"); the tests read it from
|
||||
# compose.yaml and hold every script to it. APP_DATA is renamed with the other
|
||||
# APP_ variables.
|
||||
SERVICE=app
|
||||
|
||||
set -euo pipefail
|
||||
cd "${1:-$(dirname "$(readlink -f "$0")")}"
|
||||
|
||||
@@ -15,24 +20,36 @@ cd "${1:-$(dirname "$(readlink -f "$0")")}"
|
||||
DATA=$(sed -n 's/^[[:space:]]*APP_DATA=\([^#]*\).*/\1/p' .env | tail -1 | xargs || true)
|
||||
DATA=${DATA:-./data}
|
||||
|
||||
[[ -s "$DATA/config.yaml" ]] || {
|
||||
echo "Install $DATA/config.yaml before deploying." >&2
|
||||
config=$DATA/config.yaml
|
||||
[[ -s $config ]] || {
|
||||
echo "Install $config before deploying, from config.example.yaml beside this script." >&2
|
||||
exit 1
|
||||
}
|
||||
# The two keys whose defaults are wrong in a container: `auth.enabled: auto`
|
||||
# ties the lock to how the process was started, and the default
|
||||
# database is wherever the config file happens to be. Read with grep and awk,
|
||||
# because the host need not have a Python with a YAML parser.
|
||||
if ! grep -Eq '^database:[[:space:]]*[^[:space:]#]' "$config" ||
|
||||
! awk '/^auth:/ { a = 1; next } /^[^[:space:]#]/ { a = 0 }
|
||||
a && /^[[:space:]]+enabled:[[:space:]]*[^[:space:]#]/ { found = 1 }
|
||||
END { exit !found }' "$config"; then
|
||||
echo "$config must set database and auth.enabled; config.example.yaml beside this script has both." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Pull explicitly, here and nowhere else: the compose file has no pull policy,
|
||||
# so starting or importing never fetches an image on its own. A registry
|
||||
# failure must leave the running service alone, not deploy a cache.
|
||||
echo 'Pulling the configured image…'
|
||||
if ! docker compose pull app; then
|
||||
echo 'Image pull failed; app was not restarted.' >&2
|
||||
if ! docker compose pull "$SERVICE"; then
|
||||
echo "Image pull failed; $SERVICE was not restarted." >&2
|
||||
exit 1
|
||||
fi
|
||||
# Use the image just pulled. Do not start or recreate other services in the
|
||||
# file. `--wait` holds until the container's own HEALTHCHECK passes.
|
||||
if ! docker compose up -d --no-deps --pull never --wait --wait-timeout 240 app; then
|
||||
docker compose ps app >&2 || true
|
||||
echo 'Deployment failed. Check docker compose logs app.' >&2
|
||||
if ! docker compose up -d --no-deps --pull never --wait --wait-timeout 240 "$SERVICE"; then
|
||||
docker compose ps "$SERVICE" >&2 || true
|
||||
echo "Deployment failed. Check docker compose logs $SERVICE." >&2
|
||||
exit 1
|
||||
fi
|
||||
docker compose ps app
|
||||
docker compose ps "$SERVICE"
|
||||
Reference in new issue
Block a user