Skip to content

Devops: harden local Docker + dev-server setup (lessons from OurHomii) #2

Description

@CheckPickerUpper

Why

Bringing up OurHomii locally surfaced several devops footguns shared by every jakuta-stack venture (Rust backend + docker-compose Postgres/Redis + Makefile). Filing here so this venture's setup gets hardened the same way. Tick each item against this repo.

Checklist

1. make dev-server must name the binary

The workspace has more than one bin (server + contract-codegen), so bare cargo run fails with "could not determine which binary to run".

  • dev-server / staging-server run cargo run --bin <server-bin>, not bare cargo run.

2. Docker Postgres port can silently fail to publish (Windows/WSL)

docker compose up can leave Postgres 5432/tcp unpublished (empty host binding) while Redis publishes fine, so the backend connects to nothing and dies with a config exit.

  • make dev-infra (or a make dev) proves the DB is reachable at the configured DATABASE_URL before starting the server (pg_isready / TCP wait), failing loud with the exact URL on mismatch.
  • The host DB port is single-sourced — the compose host port and DATABASE_URL derive from one value so they cannot drift.
  • If host 5432 will not bind, remap to a high host port (e.g. 15432:5432) instead of fighting it.

3. Boot failures must be visible

jakuta-rust-shared now surfaces boot-step failures on stderr before exit (Jakuta-Inc/jakuta-rust-shared#1197 — a boot reject used to log only via tracing, dropped before any subscriber, so a failed boot exited silently).

  • Bump this venture's jakuta-* pin to include that fix, so a failed boot prints its cause.

4. dev-server env + CWD

  • make dev-server sources .env.development.local (creating it from the example on first run if absent) and runs the server from the crate dir it expects (relative asset/cache paths).

5. One make dev

  • A single make dev: infra up on the agreed port -> wait for DB reachable -> run the right binary from the right CWD -> fail loud. One command, no ritual.

Filed from the OurHomii devops hardening pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions