compose: fix server command structure (critical bug)

Compose shlex-splits 'command: |' block scalar into a list when used with
'entrypoint: ["/bin/sh","-c"]'. Docker then runs '/bin/sh -c exec' where
'exec' is the only -c argument and '/app/llama-server' becomes $0. 'exec'
with no program in sh exits 0 immediately → 37-restart crash-loop, no server.

Fix: use 'entrypoint: []' and 'command: [/bin/sh, -c, <|block>]' so the full
shell command is passed as a single list element — not further split by Compose.
This commit is contained in:
2026-05-06 23:31:12 +02:00
parent e7e389c0e1
commit 322364e6fc

View File

@@ -67,8 +67,15 @@ x-server: &server
soft: -1 soft: -1
hard: -1 hard: -1
restart: unless-stopped restart: unless-stopped
entrypoint: ["/bin/sh", "-c"] # NOTE: command must be a list with the shell as explicit elements — do NOT use
command: | # `entrypoint: ["/bin/sh","-c"]` + `command: |` block scalar, because Compose
# shlex-splits the block scalar into a list and Docker then passes only "exec"
# as the -c argument (the rest become $0, $1 … → instant exit 0).
entrypoint: []
command:
- /bin/sh
- -c
- |
exec /app/llama-server \ exec /app/llama-server \
--model "/models/$$MODEL_FILE" \ --model "/models/$$MODEL_FILE" \
--host 0.0.0.0 --port 8080 \ --host 0.0.0.0 --port 8080 \