Skip to content
Merged
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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,21 @@ The command waits for both application services to become healthy, then prints
the frontend URL. Open `http://localhost:5173`, register a local account, add a
repository, and start analysis. Press `Ctrl+C` to stop all four services.

On repeat runs the images are reused from cache, so startup is fast. If you have
already built the images once and only want to restart the existing containers
without the build step, use:

```bash
npm run partha:up
```

To stop the stack without the interactive `Ctrl+C` (for example from another
terminal), use:

```bash
npm run partha:down
```

PostgreSQL data and imported repository storage persist across ordinary stops
and restarts. To permanently delete that local Compose data and return to a
clean state, run:
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
],
"scripts": {
"partha": "node scripts/partha.mjs",
"partha:up": "node scripts/partha.mjs --no-build",
"partha:down": "docker compose down",
"dev:frontend": "npm --prefix apps/frontend run dev",
"build:frontend": "npm --prefix apps/frontend run build",
"preview:frontend": "npm --prefix apps/frontend run preview",
Expand Down
6 changes: 5 additions & 1 deletion scripts/partha.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ let interrupted = false;
let startupAttempted = false;
let releaseKeepAlive;

// `--no-build` skips image builds for instant restarts once images exist.
const NO_BUILD = process.argv.includes('--no-build');
const COMPOSE_UP_ARGS = NO_BUILD ? ['up', '--wait'] : ['up', '--build', '--wait'];

function commandOutput(result) {
return [result.stdout, result.stderr]
.filter(Boolean)
Expand Down Expand Up @@ -128,7 +132,7 @@ async function main() {

try {
startupAttempted = true;
await run('docker', ['compose', 'up', '--build', '--wait']);
await run('docker', ['compose', ...COMPOSE_UP_ARGS]);
await Promise.all([
waitForUrl(API_READY_URL, 'PARTHA API'),
waitForUrl(FRONTEND_URL, 'PARTHA frontend'),
Expand Down
Loading