Start here. This is the direct spoken answer to practice first.
Why this question matters
Stateful local dependencies expose a real trade-off: fast repeatable startup and useful retained data pull in opposite directions. The design needs an intentional reset path and must not let convenient development credentials become a production secret strategy.
Container lifetime and data lifetime are separate choices. A persistent container can keep the same container between runs, while a volume keeps data even when that container is recreated. Local development may use either for convenience, but tests usually need isolated disposable state. Production durability belongs to an explicitly managed resource, not an accidental developer volume.