Interview Prep/Docker/Rapid-Fire Commands

Create an internal network, a volume with a label, and run a DB attached to both.

IntermediateProductionRapid-Fire Commands
Answer
docker network create --internal backend
docker volume create --label team=payments pgdata
docker run -d --name db --network backend -v pgdata:/var/lib/postgresql/data \
  -e POSTGRES_PASSWORD_FILE=/run/secrets/pw postgres:16

(Mount the secret file or use an env value in a lab.)

All Docker questions Roadmap: Docker & containers

More on Rapid-Fire Commands