Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@ WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

CMD ["gunicorn", "-c", "gunicorn.conf.py", "app:app"]
# SANDBOX_MODE: "push" (default, legacy Flask server) or "pull" (runner client)
ENV SANDBOX_MODE=push

CMD if [ "$SANDBOX_MODE" = "pull" ]; then \
exec python runner_client.py; \
else \
exec gunicorn -c gunicorn.conf.py app:app; \
fi
Comment on lines +12 to +16
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shell-form CMD runs under /bin/sh -c, so the actual process (python/gunicorn) won't be PID 1 and may not receive SIGTERM/SIGINT properly (can break graceful shutdown and health signaling). Prefer an ENTRYPOINT script or sh -c with exec in both branches so the selected process becomes PID 1.

Suggested change
CMD if [ "$SANDBOX_MODE" = "pull" ]; then \
python runner_client.py; \
else \
gunicorn -c gunicorn.conf.py app:app; \
fi
CMD ["/bin/sh", "-c", "if [ \"$SANDBOX_MODE\" = \"pull\" ]; then exec python runner_client.py; else exec gunicorn -c gunicorn.conf.py app:app; fi"]

Copilot uses AI. Check for mistakes.
Loading
Loading