IMGIITRoorkee / IMGIITRoorkee/chakra-docker

prod.sh interrupt trap can run docker-compose down outside the repo

Open Beginner friendly
#32 0 comments 0 reactions 0 assignees View on GitHub
audit effort:S infra sev:medium
Dominant language
HTML
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

`handle_interrupt()` runs `cd ../../` unconditionally, but the matching `cd codebase/chakra-core` is not until line 15. Ctrl-C during Docker startup fires the trap **before** that `cd`, so `cd ../../` walks two levels *out* of the repo and `docker-compose down` runs where there is no compose file.

The operator believes they stopped the stack; it is still running.

**Fix:** capture the root once and use it absolutely — `ROOT="$(cd "$(dirname "$0")/.." && pwd)"`, then `docker compose -f "$ROOT/docker-compose.yml" down`.

---

**Evidence**

```
scripts/prod.sh:9-13
```

- Verified against: `origin/master 44ca47e (2026-07-25)`
- Verdict: **CONFIRMED**

Contributor guide

No contributing guide indexed for this repository

Research direction

Open scripts/prod.sh and inspect the handle_interrupt() trap and the startup path around lines 9-15. Verify the repository root is captured before startup can be interrupted, then run the script's Docker startup and interrupt it to confirm docker compose down uses docker-compose.yml from the repository root.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, shell
Domain
devops, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
86/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.