To simplify human understanding and tooling, we need to establish some path conventions for our containers.
Assumptions / considerations
- Only run a single service per container
- Prioritize keeping things simple. Don't require path templating by service name.
- Downside: Makes it harder to reuse scripts outside of containers.
Where the service's code will live.
- /srv/service -- Follows srv convention.
- /opt/service (used currently in service-runner-based Dockerfiles)
- /src -- Fairly common in other containers.
- /srv -- Standard location for site-specific data.
Regular service startup executable or script.
Test Entry Point
Run tests in container
Data directories. Typically externally mounted volumes.
- /data -- Fairly common in docker containers.
Read-only, often from Kubernetes config maps.
- /conf -- Common in docker containers.
- /etc/service -- Follows etc convention.