docker: ship anime_sort.lua but don't load a script by default
Bundle the example Lua scripts under /app/scripts and have the entrypoint load one only when NAUT_SCRIPT is set. NAUT_SCRIPT is left unset by default, so the daemon starts with no script; set it (e.g. /app/scripts/anime_sort.lua) to opt in. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
6107846fc9
commit
eb226b4af3
1 changed files with 9 additions and 2 deletions
11
Dockerfile
11
Dockerfile
|
|
@ -82,6 +82,10 @@ COPY --from=build /src/build/torrent-peer/libtorrentpeer.so /usr/local/lib
|
|||
COPY --from=build /src/build/torrent-tracker/libtorrenttracker.so /usr/local/lib/
|
||||
RUN ldconfig
|
||||
|
||||
# Bundled Lua scripts (anime_sort.lua and friends). Loaded by default via
|
||||
# NAUT_SCRIPT below; the daemon runs one script at a time.
|
||||
COPY --from=build /src/examples /app/scripts
|
||||
|
||||
# Defaults — override any of these at `docker run` time with -e.
|
||||
ENV NAUT_WEBUI_HOST=0.0.0.0 \
|
||||
NAUT_WEBUI_PORT=8080 \
|
||||
|
|
@ -93,14 +97,17 @@ ENV NAUT_WEBUI_HOST=0.0.0.0 \
|
|||
# NAUT_AUTH_USER=admin # default
|
||||
# NAUT_AUTH_PASSWORD=... # generated + printed to the log if unset
|
||||
# NAUT_SESSION_TTL=604800 # login lifetime in seconds (default 7d)
|
||||
# NAUT_SCRIPT=/app/scripts/anime_sort.lua # set to load a script at startup
|
||||
|
||||
# Create the data/download/socket dirs (if the volume is fresh) then exec the
|
||||
# daemon with the webui plugin. Built with printf (single-quoted lines keep the
|
||||
# $VARs literal) so the image stays a single Dockerfile on any builder.
|
||||
# daemon with the webui plugin and the configured script. Built with printf
|
||||
# (single-quoted lines keep the $VARs literal) so the image stays a single
|
||||
# Dockerfile on any builder. --script is only added when NAUT_SCRIPT is set.
|
||||
RUN printf '%s\n' \
|
||||
'#!/bin/sh' \
|
||||
'set -e' \
|
||||
'mkdir -p "$NAUT_STATE_DIR" "$NAUT_WEBUI_SAVE_PATH" "$(dirname "$NAUT_WEBUI_DB")" "$(dirname "$NAUT_SOCKET")"' \
|
||||
'[ -n "$NAUT_SCRIPT" ] && set -- --script "$NAUT_SCRIPT" "$@"' \
|
||||
'exec /app/nautd --socket "$NAUT_SOCKET" --plugin /app/naut_webui.so --state-dir "$NAUT_STATE_DIR" "$@"' \
|
||||
> /usr/local/bin/entrypoint.sh \
|
||||
&& chmod +x /usr/local/bin/entrypoint.sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue