Skip to content

About

Minimal, disposable service units for standing up a working environment on a machine you have never seen before.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

infra-blocks

License: MIT Repository size

Minimal, disposable service units for standing up a working environment on a machine you have never seen before.

Each unit is one repository. Copy .env.example to .env, run docker compose up -d, and you have a service listening on a documented port with a documented credential. docker compose down -v removes all trace of it. The exception is k3s: it installs onto the host rather than into containers, so its repository carries the commands and the traps instead of a compose file.

Two ways to take one: clone it when you want to follow fixes to the unit itself, or Use this template to start a repository you own — the copy has no history and never receives upstream changes. Template status stops at the units: this catalogue is a directory, not a project, so it cannot be used as a template and does not try to be. Copy the units.

Nothing here is clever. Everything here is meant to survive being run by someone who did not write it — on a client's own hardware, behind their firewall, without a vendor console in the loop.

Why this exists

Most integration work in China fails at the same three places: the image registry cannot be reached, the certificate cannot be issued because port 80 is closed, and nobody can say afterwards what was running where.

These units are built around those three failures. Each one documents its registry mirror configuration, its TLS strategy, and the exact ports and volumes it occupies.

Units

Two groups. Runtime serves traffic or keeps the machines talking; storage still holds data after the process stops.

Every unit follows the same rules: one service, one port, one documented credential, removed with docker compose down -v. The ports below are defaults, and every one is a variable in .env — change it without touching the compose file; k3s takes its API port from the install command in its own README. Each cell is a list with the service port first: that is the one a firewall rule gets written against.

Runtime

Unit What it gives you Default ports When a client needs it
caddy Automatic TLS reverse proxy, DNS-01 via Cloudflare 443 (HTTPS)
80 (HTTP → redirect)
443/udp (HTTP/3)
Port 80 is closed by policy, or the domain sits behind Cloudflare
gitea Self-hosted Git 3000 (web)
2222 (SSH)
Code cannot leave the intranet, or a contractor handover needs a private repo
k3s Single-binary Kubernetes, with Tailscale joining cloud and on-prem nodes into one network 6443 (API server) They have a server room and cloud hosts, and want one place to deploy
prometheus Prometheus + Grafana + node-exporter 9090 (Prometheus)
3000 (Grafana)
9100 (node-exporter)
The first time they ask "how do we know the server is still up"
verdaccio Private npm registry 4873 Private packages cannot go public, and builds must be reproducible offline
wordpress WordPress on MySQL 80 They want a site they can edit themselves, not a developer for every sentence

Storage

Unit What it gives you Default ports When a client needs it
influxdb InfluxDB 3 with its own query UI 8181 (HTTP)
8888 (UI)
Time series from sensors — the IoT side of the house
mongodb MongoDB with the official Node.js driver 27017 Document data, or a schema that is still moving
mysql MySQL / MariaDB with Adminer 3306 (MySQL)
8080 (Adminer)
Migrating off a legacy system that was already MySQL
neo4j Neo4j with the official Node.js driver 7687 (Bolt)
7474 (Neo4j Browser)
The question is about multi-hop relationships a join table cannot express
postgresql PostgreSQL with Adminer 5432 (PostgreSQL)
8081 (Adminer)
Someone other than you needs to open the data and look at it
redis Redis with the official Node.js client 6379 Cache, session store, or a job queue

UI and agent ports sit under the service port: Adminer under PostgreSQL and MySQL, Grafana under Prometheus, the browser under Neo4j, the HTTP API above the UI in InfluxDB. They are listed because they are the ports the person you are handing over to will actually open. Prometheus sits with runtime rather than storage — it does keep samples, but what you operate is a monitoring service.

Not in this list

Application starters live in their own family: fiber, flask, koajs, actix-web. They answer "what do I write the app in", which is a different question from "how do I make it run there".

Hardware work sits outside both families — one device each, no reuse: poc-raspi-pca9685-barrier-gate asks whether a gate that is already installed can be driven from the software the site already runs, poc-raspi-dht-sensor collects DHT11 readings into InfluxDB, and poc-esp-morsecho acknowledges MQTT commands by blinking Morse on an ESP32-S3. They answer "does this even work", "does the reading survive the trip" and "can a headless device be reached at all", which are the questions you ask before either of the other two.

Conventions

  • Ports are declared in .env, not hardcoded. The template is always .env.example: cp .env.example .env before the first up.
  • Credentials in the README are for local use only and are marked as such.
  • Every unit has a Verify section with a command that proves the service actually answers.
  • Ports are published on the host, not bound to 127.0.0.1 by default — these units are meant for a machine you already control. On a host with a public interface, change ${PORT}:… to 127.0.0.1:${PORT}:… before the first up.

License

MIT — see LICENSE. Take what is useful.

Maintained by

Kamas Lau — kamaslau.com · I do this for foreign companies operating in China, on their own infrastructure.

About

Minimal, disposable service units for standing up a working environment on a machine you have never seen before.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Contributors