Habib Ali Machpud
← Architecture decisions

Architecture decision

ADR-017: Docker Compose on the VPS

Use a fixed Compose runtime with pinned images and a restricted deployment gateway.

Context

Ask Habib starts on one VPS. Its current runtime consists of a static web server and reverse proxy, a Go API, and an outbound tunnel connector. The application needs explicit service identities, private networks, restart behavior, restricted filesystems, and repeatable image selection.

There is no measured requirement for scheduling workloads across hosts. The first operational requirement is to understand and recover one small deployment, then use that same path for later application changes.

Decision

Use Docker Compose as the runtime service definition. Keep images immutable and build them outside production. The deployment tool selects a verified API/web image pair; the reviewed Compose policy defines the remaining runtime behavior.

Automatic deployment does not accept a new Compose file from each release. The host retains a root-owned policy and fixed network boundaries. Policy changes are reviewed separately from image changes. This keeps the authority to deploy an application version distinct from permission to change its host access.

The host service manager schedules the deployment poller. Compose manages the application containers. These are separate responsibilities rather than two competing definitions of the same application services.

Alternatives considered

Individual container commands could express the same runtime settings, but the relationships and restrictions would be spread across operational commands. A single declarative policy makes those settings easier to compare and review.

A separate host service definition for every application process could also work. For the current containerized images, that would add another place to coordinate service networks, image references, and the deployment sequence.

Kubernetes would provide a model for cluster scheduling and richer rollout controllers. The initial project has not established a need for those capabilities or the additional cluster operations they introduce.

Consequences

The application topology is visible in one policy and can be exercised by local container tests and native release validation. A deployment can identify its exact images without rebuilding them on the host.

Compose does not make the single host highly available, supply an application rollback transaction, or prove that public ingress works. The deployment gateway must check the running version, verify the public path, retain previous image references, and report a failed restoration honestly. A container restart policy also does not replace backups or future database recovery testing.

The fixed policy is a deliberate constraint. Adding persistent data, changing network access, or introducing migration ordering requires another reviewed operational change. Such changes are not ordinary image substitutions.

Revisit when

Reassess orchestration when measured availability, workload placement, scaling, or recovery requirements exceed this model. Compare the operational cost of the replacement with the specific requirement it solves.

Related decision: start on one VPS.