Update Infrastructure
When to Use
A project involves changes to Forge infrastructure: Railway services, databases, volumes, environment variables, Docker images, or deployment configuration.
Prerequisites
- Access to Railway (via
railwayMCP or dashboard) - Current
Forge_Infrastructure.mdreflects the live state - Access to the uvilo-mono repository (
prodRepoRoot—/workspace/erik@uvilo.com/uvilo-mono) for deployment docs and repo structure
Procedure
- Read
Forge/Forge_Infrastructure.mdfor current state - For current deployment procedures, refer to
docs/deployment.mdin the uvilo-mono repository (prodRepoRoot—/workspace/erik@uvilo.com/uvilo-mono) - For database branching, migration, and environment configuration procedures, refer to the uvilo-mono repository structure
- If deploying a new service, run the Setup sub-procedure (below) before planning
- Plan the change — identify every service, variable, and dependency affected
- Run the persistence checklist (below) for every stateful service touched
- Execute the change
- Verify every item in the persistence checklist passes (stateless services: skip if no checklist items apply)
- Update
Forge_Infrastructure.mdto reflect the new state — place lessons next to the relevant section, not in a catch-all at the bottom - If a lesson has no related section, append it to the bottom “Lessons” section
- Commit
Setup Sub-Procedure (New Services Only)
Run these steps when adding a service that does not yet exist in the project:
- Check prerequisites from upstream docs (minimum version, required API surface, auth requirements)
- Classify the service as stateful (database, search index, queue — needs volume + backups) or stateless (API, UI, proxy — no volume)
- Generate and store any required secrets before creating the service (store in RoboForm)
- Create the service:
service_create_from_imagefor Docker images; Railway “Add Database” for stateful data services - Set all required env vars and create a public domain
- Verify the deployment is healthy before proceeding with the rest of the procedure
Persistence Checklist
Run for every stateful service (database, search index, queue, object store) that the change touches:
| # | Check | How to verify |
|---|---|---|
| P1 | Version matches spec/requirements | Check image tag or db.version() |
| P2 | Persistent volume attached | Railway: Volumes tab visible; data survives redeploy |
| P3 | Backups available | Railway: Backups tab exists and is not empty |
| P4 | Connection strings point to correct service | Verify service-specific connection URL / host env vars match the target service |
| P5 | Auth configured and working | Follow the current uvilo-mono deployment docs and repo structure for the touched service; test with that service’s supported client/tooling |
| P6 | If any secrets or env vars have been changed | Prompted Operator to update secrets in RoboForm |
If any check fails, stop and fix before proceeding. Do not mark the change complete with a failing check.
Rules
- Never deploy a stateful service without a persistent volume
- Never assume a service version — verify it
- Every infrastructure change must update
references/infrastructure_state.mdandForge_Infrastructure.mdin the same commit - Lessons go next to the relevant section; only genuinely unplaceable lessons go at the bottom