Applies to: Any containerized service running at a federation site.
A Docker service must be reproducible from its compose file + config alone. No manual steps hidden in VMs, no notes only in someone’s head. If the host dies, docker compose up on a new host rebuilds the service.
VM with Docker installed
└── manually configured services
└── notes inside the VM (in /root/README or description field)
└── "it works, don't touch it"
Why this fails: VM dies, notes are lost, no one knows how to rebuild.
<site-compose-repo>/
├── <service-name>/
│ ├── docker-compose.yml # Service definition (git tracked)
│ ├── .env # Secrets (gitignored, backed up per repo-private-data)
│ ├── config/ # Mounted configs (git tracked where possible)
│ └── README.md # Setup notes, decisions, troubleshooting
Everything needed to rebuild lives in the repo. The VM/host is disposable.
# <service-name>/docker-compose.yml
version: "3"
services:
<service>:
image: <image>:<pinned-version>
container_name: <service-name>
restart: unless-stopped
ports:
- "<host-port>:<container-port>"
volumes:
- ./config:/config # config files (git tracked)
- <named-volume>:/data # persistent data (backed up)
env_file:
- .env # secrets (not in git)
networks:
- <network-name>
volumes:
<named-volume>:
networks:
<network-name>:
external: true
image: plex:1.32.5 not image: plex:latestEach site has a compose repo:
| Site | Repo | Host |
|---|---|---|
| cf | docker-compose gitea | nsdockerhv |
| wf | TBD (create when deploying services on cg2) | cg2 or VM on cg2 |
| sl | TBD | slwin11ops (if needed) |
If the host dies:
curl -fsSL https://get.docker.com | shgit clone <repo>cd <service> && docker compose up -dIf you can’t do step 6 and have it work, your compose repo is incomplete.
When you find a VM with manually configured Docker services:
docker psdocker inspect <container> - extract volumes, ports, envfind / -name "docker-compose.yml" 2>/dev/nulldocker compose down && docker compose up -d (does it come back clean?)Add to site status script:
# Check Docker services are running
docker ps --format " " | grep -v "Up" && echo "CONTAINER DOWN" || echo "All containers UP"