Skip to content

Instantly share code, notes, and snippets.

@kylewlacy
Created April 9, 2025 03:03
Show Gist options
  • Save kylewlacy/32f95b5a2a753803b1187779fe911490 to your computer and use it in GitHub Desktop.
Save kylewlacy/32f95b5a2a753803b1187779fe911490 to your computer and use it in GitHub Desktop.
Sketch of using Brioche + Just + Process Compose for managing services
test: services-start
node src/example.js
services-start:
process-compose up -D
environment:
# The directory where the database files will be stored
- PGDATA=./db
processes:
# The Postgres server
database:
command: "postgres"
depends_on:
database-setup:
condition: process_completed_successfully
# Create a new database before starting Postgres
database-setup:
command: "initdb || true"
import * as std from "std";
import processCompose from "process_compose";
import just from "just";
import postgresql from "postgresql";
import nodejs from "nodejs";
// Run with `brioche run -e runTests`
export function runTests() {
return std.bashRunnable`
just test
`.dependencies(std.bash(), just(), processCompose(), postgresql(), nodejs());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment