Files
docker/infrastructure/terraform/docker
..

Terraform Docker Mirror Layer

This directory tracks selected existing Docker containers in Terraform for inventory/documentation purposes.

Purpose

  • Mirror specific running containers as Terraform resources.
  • Reconcile imported state into maintainable code.
  • Produce structured outputs/reminders that support documentation workflows.

Boundary with Docker Compose

Docker Compose + services-up.sh remain runtime composition authority.

Terraform resources here are not the primary day-to-day deployment mechanism for app services.

Current contents

  • main.tf — import-first workflow notes and minimal scaffolding.
  • searxng-webapp.tf — generated/reconciled example container resource.
  • outputs.tf — documentation-oriented reminders/outputs.
  • terraform.tfvars.example — safe template for local values.

Import/reconciliation workflow

  1. Start with one existing container.
  2. Import with import {} block or terraform import.
  3. Inspect state / generated config.
  4. Reduce generated attributes to meaningful, stable arguments.
  5. Keep lifecycle ignore_changes narrow and justified.
  6. Iterate until plan is clean for the intended resource.

Guardrails

  • Do not attempt to mirror all containers in one pass.
  • Do not commit local state or real credentials.
  • Treat generated config as draft input that needs review.