Skip to content

fix(docker): exec the compose command instead of always starting the server - #546

Open
Eljees wants to merge 1 commit into
infobyte:masterfrom
Eljees:fix/entrypoint-exec-command-544
Open

fix(docker): exec the compose command instead of always starting the server#546
Eljees wants to merge 1 commit into
infobyte:masterfrom
Eljees:fix/entrypoint-exec-command-544

Conversation

@Eljees

@Eljees Eljees commented Jul 28, 2026

Copy link
Copy Markdown

Fixes #544

docker/entrypoint.sh ends with a hardcoded server start and never looks at its arguments, so the
command: from docker-compose is ignored by every container built on this image. In the default stack
that means faraday-default-worker (compose declares command: [ "faraday-worker" ]) starts a second
server
instead of a Celery consumer:

Starting Faraday server ...
WARNING - Faraday Server is already running. PID: 21

and every report uploaded via CLI/Web UI/API queues in Redis forever (redis-cli LLEN celery keeps
growing, celery inspect ping → "No nodes replied").

The entrypoint now execs the passed command when there is one, and keeps the current behaviour when
there is none:

if [ "$#" -gt 0 ]; then
    echo "$(date) Executing command: $*"
    exec "$@"
fi

echo "$(date) Starting Faraday server ..."
exec faraday-server --bind 0.0.0.0

exec also makes PID 1 the actual service in both cases, so signals from docker stop reach the
server/worker instead of the shell.

The init part of the script (server.ini creation, migrations) still runs for the worker as before —
the worker starts with depends_on: service_healthy, so it takes the "Using existing server.ini" branch;
this PR does not change that behaviour, it only stops the worker from turning into a second server.

Verified

bash -n docker/entrypoint.sh clean, plus a stub run (fake faraday-server/faraday-manage/nc on PATH,
existing server.ini):

with a command:    Executing command: echo I-AM-THE-WORKER   ->  I-AM-THE-WORKER
without a command: Starting Faraday server ...               ->  faraday-server --bind 0.0.0.0

AI-assisted (LLM used for drafting); the change and the runs above are mine.

…server

The entrypoint ignored its arguments, so faraday-default-worker started a second faraday-server and no Celery consumer ever ran; queued reports were never imported.

Signed-off-by: Eljees <3.14hell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

entrypoint.sh ignores container command: faraday-default-worker runs a second server instead of a Celery worker

1 participant