Skip to content

Fix local Docker startup loop and supervisorctl bootstrap issues#1074

Open
B4rakH wants to merge 1 commit intof:mainfrom
B4rakH:fix/local-setup
Open

Fix local Docker startup loop and supervisorctl bootstrap issues#1074
B4rakH wants to merge 1 commit intof:mainfrom
B4rakH:fix/local-setup

Conversation

@B4rakH
Copy link
Copy Markdown

@B4rakH B4rakH commented Mar 14, 2026

Description

This PR fixes local Docker startup issues encountered on first container launch.

Main updates:

  • Fixed supervisorctl readiness check in docker/bootstrap.sh to wait for postgresql running state (instead of a generic status check that could loop).
  • Added Supervisor control socket/RPC configuration in docker/supervisord.conf so supervisorctl can connect reliably.
  • Fixed Windows CRLF compatibility in docker/Dockerfile by normalizing /bootstrap.sh line endings before execution.
  • Improved startup message in docker/bootstrap.sh to show a host-usable port (HOST_PORT fallback).

Small Changes:

  • Updated DOCKER.md local run command to include a container name for easier local management.

Type of Change

  • Bug fix
  • Documentation update

Additional Notes

This is focused on local/self-hosted container behavior, especially Windows-based development flows.
Key issue addressed: startup loop around "starting supervisord" and /bootstrap.sh execution reliability.

Summary by CodeRabbit

  • Documentation

    • Updated Docker command documentation to reference container naming.
  • New Features

    • Docker containers now have assigned names for easier management.
    • Improved startup readiness checks for database services.
    • Enhanced port information display during container initialization.
  • Bug Fixes

    • Fixed Windows line-ending compatibility in bootstrap process.

…t launch of the container

Fix 'cannot find /bootstrap.sh' in docker build
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 14, 2026

📝 Walkthrough

Walkthrough

This pull request enhances Docker containerization by adding Supervisor RPC configuration for process control, implementing CRLF line-ending normalization in the Dockerfile, narrowing the startup readiness check to specifically verify PostgreSQL status, introducing dynamic port display in the bootstrap message, and assigning an explicit container name "prompts_library".

Changes

Cohort / File(s) Summary
Documentation & Build Configuration
DOCKER.md, docker/Dockerfile
Added explicit container naming (prompts_library) to the build command and introduced CRLF-to-LF normalization via sed before chmod to ensure bootstrap script compatibility across platforms.
Startup Orchestration
docker/bootstrap.sh, docker/supervisord.conf
Introduced comprehensive Supervisor configuration with unix socket, RPC interface, and program definitions for PostgreSQL and Next.js. Refined bootstrap readiness logic to monitor only PostgreSQL instead of all services, and implemented dynamic port display with fallback logic (HOST_PORT → PORT → 80).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through Docker's den,
With Supervisord now orchestrating when,
PostgreSQL checked with careful gaze,
CRLF converted through sed's maze,
Port displays dance, bright and bold! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main issues being fixed: the Docker startup loop and supervisorctl bootstrap problems, which directly aligns with the PR's primary objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@DOCKER.md`:
- Line 189: The docker run example uses the container name "prompts_library"
which is inconsistent with the rest of the doc that references "prompts"; update
the docker run command to use the same container name ("prompts") or
alternatively normalize all other commands to "prompts_library" so they match;
search for occurrences of the strings "prompts_library" and "prompts" and make
them consistent throughout (e.g., in the docker run line and the operational
commands that reference the container name).

In `@docker/bootstrap.sh`:
- Around line 168-176: The banner currently uses DISPLAY_PORT (computed from
HOST_PORT or PORT) but gives no hint when DISPLAY_PORT is actually a container
port (when HOST_PORT is unset); update the startup banner logic around the
DISPLAY_PORT/echo lines so that if HOST_PORT is unset you append a short
clarifying note like "(container port — map with -p host:container to access via
localhost)" or similar, otherwise show "(host port)"; reference the DISPLAY_PORT
variable and the HOST_PORT/PORT resolution so you modify the echo block that
prints "Open http://localhost:${DISPLAY_PORT}" to include this conditional hint.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f05f3941-00f4-4b4b-ab7a-ee1933960c15

📥 Commits

Reviewing files that changed from the base of the PR and between 639c6ac and 8151d33.

📒 Files selected for processing (4)
  • DOCKER.md
  • docker/Dockerfile
  • docker/bootstrap.sh
  • docker/supervisord.conf

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.

1 participant