Skip to content

Stop installing the dev docker-compose unit on production hosts - #16

Merged
DenDanskeMine merged 1 commit into
mainfrom
fix/installer-dev-infra-unit
Jul 26, 2026
Merged

Stop installing the dev docker-compose unit on production hosts#16
DenDanskeMine merged 1 commit into
mainfrom
fix/installer-dev-infra-unit

Conversation

@DenDanskeMine

Copy link
Copy Markdown
Contributor

Fixes #14.

A production install provisions PostgreSQL and Redis natively — install.sh enables the distro services and creates the role and database with psql. But it also ran make install-services, which links the dev unit set, and that includes danbyte-infra: docker compose up -d postgres redis. Then danbyte-web and danbyte-workers both declared Wants=danbyte-infra.service, so enabling them started the container stack.

On a host that already ran PostgreSQL that left an idle container with an empty database, publishing 5432 against the server Danbyte is actually using.

Worth calling out: harmless as observed, but the two compete for the port and whichever starts first wins it. A reboot could have pointed Danbyte at the empty container, migrated into it, and looked exactly like total data loss — while the real data sat unreachable in the host cluster.

Changes

  • Makefile — split the unit list into DEV_SERVICES (mockups, infra, backend) and SHARED_SERVICES (workers, docs). PROD_SERVICES is now the full production set, and install-prod-services links and enables the timers too, since install.sh no longer calls install-services for them.
  • scripts/install.sh — link PROD_SERVICES only.
  • services/danbyte-web.service, services/danbyte-workers.service — drop Wants=danbyte-infra.service. It's a dev convenience with no business in a unit shipped to production. danbyte-backend (dev-only) keeps it, and make up starts infra explicitly, so the dev workflow is unchanged.
  • docs/getting-started/installation.md — state that production uses native PostgreSQL/Redis and that compose is development only, how to point an install at an existing server, and how to remove the stray unit and container from an install made before this fix.

Notes

Existing installs are unaffected until they re-run the installer; the docs note covers manual cleanup. make docs-build is clean and bash -n scripts/install.sh passes.

Fixes #14.

A production install provisions PostgreSQL and Redis natively — install.sh
enables the distro services and creates the role and database with psql. But it
also ran `make install-services`, which links the DEV unit set, and that
includes `danbyte-infra`: `docker compose up -d postgres redis`. Then
danbyte-web and danbyte-workers both declared `Wants=danbyte-infra.service`, so
enabling them started the container stack.

The result on a host that already ran PostgreSQL: an idle container with an
empty database, publishing 5432 against the server Danbyte is actually using.
Harmless as observed, but the two compete for the port and whichever starts
first wins it — so a reboot could have pointed Danbyte at the empty container,
migrated into it, and looked exactly like total data loss.

- Makefile: split the unit list into DEV_SERVICES (mockups, infra, backend) and
  SHARED_SERVICES (workers, docs). PROD_SERVICES is now the full production set,
  and install-prod-services links and enables the timers too, since install.sh
  no longer calls install-services for them.
- install.sh: link PROD_SERVICES only.
- danbyte-web, danbyte-workers: drop `Wants=danbyte-infra.service`. It is a dev
  convenience and has no business in a unit shipped to production;
  danbyte-backend (dev-only) keeps it, and `make up` starts infra explicitly.
- Docs: state that production uses native PostgreSQL/Redis and that compose is
  development only, how to point an install at an existing server, and how to
  remove the stray unit and container from an install made before this fix.

Existing installs are unaffected until re-run; the docs note covers cleanup.
@github-project-automation github-project-automation Bot moved this to Todo in Roadmap Jul 26, 2026
@DenDanskeMine
DenDanskeMine merged commit 48f9c10 into main Jul 26, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Jul 26, 2026
@DenDanskeMine
DenDanskeMine deleted the fix/installer-dev-infra-unit branch July 26, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Question about danbyte-infra.service when using an existing PostgreSQL installation

1 participant