dobrovolskiy.com
RU
← all workinfrastructure · 2026

Shared Postgres stack

One hardened Postgres 16 instance with per-project roles/databases for a multi-tenant Docker host

Infrastructure recipe that consolidates the per-project Postgres containers on the author's production server into a single postgres:16-alpine instance on an isolated database-only Docker...

Infrastructure recipe that consolidates the per-project Postgres containers on the author's production server into a single postgres:16-alpine instance on an isolated database-only Docker network with no published ports.

An idempotent provisioning script creates a role + database per project with revoked public access and prints the DATABASE_URL, and the README documents backups, restores and when a dedicated instance is still justified.

What it does

  • Dedicated external db_net network; not on the proxy network, no host ports
  • provision-db.sh: idempotent role+database creation, password generation/rotation, REVOKE ALL FROM PUBLIC
  • Tuned shm_size, max_connections and shared_buffers for a shared instance
  • Stable UTF8/C collation policy and documented pg_dump/pg_dumpall backup and restore

Small but shows ops maturity: network-level isolation, least-privilege roles, idempotent scripts. Best presented as part of a 'self-hosted infrastructure' section rather than a standalone project.

Want something like this?

I build it live on a Zoom call, you watch the screen, the timer stops when you say stop. First 15 minutes are free.

$50 / hourBook an hour

More projects

geo.ryta.online: self-hosted maps APISelf-hosted OpenStreetMap stack for Russia/CIS: vector tiles, Photon geocoder and a metered API gateway with paid plansFOURLEDS Cloud ControllersCellular lighting controllers for heritage facades: six KiCad boards, ESP-IDF firmware, fleet server, dashboardUltralight IP CAM ViewerUltra-light multi-camera RTSP viewer and recorder: dozens of cameras on one slow PC or server