Dockerless PostgreSQL
Scope This guide only applies to GitHub Copilot's Codex (or similar managed) sandboxes where Docker is disabled. These scripts are not meant for normal local workstations; if you have Docker available, follow the standard workflow in Local Development instead.
The repository ships a thin wrapper around the system PostgreSQL packages so that integration tests and local tooling work in Dockerless sandboxes. The scripts live under scripts/ and are idempotent, so you can run them whenever the environment is reset.
One-time bootstrap
sudo ./scripts/codex-setup.sh
Run this only inside the Codex VM (the script auto-detects the
/workspace/Hephaestuscheckout). If detection ever fails, passHEPHAESTUS_ROOT=/workspace/Hephaestusexplicitly.
What the script does:
- Installs PostgreSQL server/client packages via
apt-getwhen they are missing. - Installs top-level npm dependencies (
npm install). - Bootstraps the shared Python tooling (
npm run bootstrap:py). - Creates and initialises a managed database cluster in
server/application-server/postgres-data-local/usingscripts/local-postgres.sh.
If
sudois unavailable, run the script as the root user. The script exits early rather than attempting a partial install.
Daily maintenance
Codex reboots the VM between sessions, so use the lightweight helper whenever the sandbox wakes up from cold storage:
./scripts/codex-maintenance.sh
It ensures the local cluster is running (scripts/local-postgres.sh start) and refreshes npm dependencies with cached modules (npm install --prefer-offline).
Database helpers and tests
- All
npm run db:*utilities automatically fall back to the managed cluster when Docker is missing. SetHEPHAESTUS_DB_MODE=localto force that behaviour even on hosts that have Docker installed. - The Maven Surefire/Failsafe configuration extends the fork timeout to 180 seconds when
HEPHAESTUS_DB_MODE=local, giving the local cluster enough time to warm up during integration tests. - The integration-test harness (
PostgreSQLTestContainer) connects to the managed cluster whenever Docker is unavailable.
Manual control
You can manage the database directly:
scripts/local-postgres.sh status # check
scripts/local-postgres.sh stop # free port 5432
scripts/local-postgres.sh start # restart after stop
The script reuses the system PostgreSQL binaries provided in the Codex base image. On Codex sandboxes without a postgres user it runs the cluster under the invoking user; on Linux desktops it would fall back to runuser/su, but local machines should rely on Docker instead.
Limitations
- Keycloak and the remaining Docker Compose services still require Docker.
scripts/local-postgres.shexpects PostgreSQL 14+ binaries (pg_ctl,pg_isready). Run./scripts/codex-setup.shif commands are missing.- Always stop the cluster when you finish (
scripts/local-postgres.sh stop) to leave port 5432 free for other workflows.