Using Docker compose you can define a set of containers, along with their relationships, in a YAML file. And then use the docker-compose CLI to launch and manage them.
For this example there's a compose file using the version 2 schema. This means you will need at least Docker Engine 1.10 and Compose 1.6.
Here's the docker-compose.yml for the your scenario:
version: '2'
services:
puppet:
container_name: puppet
hostname: puppet
image: puppet/puppetserver
ports:
- 8140
volumes:
- ./code:/etc/puppetlabs/code/
- ./puppet/ssl:/etc/puppetlabs/puppet/ssl/
- ./puppet/serverdata:/opt/puppetlabs/server/data/puppetserver/
#environment:
# - PUPPETDB_SERVER_URLS=https://puppetdb.local:8081
#links:
# - puppetdb:puppetdb.local
puppetdb-postgres:
container_name: postgres
image: puppet/puppetdb-postgres
environment:
- POSTGRES_PASSWORD=puppetdb
- POSTGRES_USER=puppetdb
expose:
-5432
volumes:
- ./puppetdb-postgres/data:/var/lib/postgresql/data/
puppetdb:
hostname: puppetdb
image: puppet/puppetdb
ports:
- 8080
- 8081
volumes:
- ./puppetdb/ssl:/etc/puppetlabs/puppet/ssl/
puppetboard:
image: puppet/puppetboard
ports:
- 8000
puppetexplorer:
image: puppet/puppetexplorer
ports:
- 80
read_only: true