
postgres:
  image: centos:7
  environment:
    - POSTGRES_DB=mydb
    - POSTGRES_USER=admin
    - POSTGRES_PASS=admin
    - PGDATA=/var/lib/pgsql/data
  user: postgres
  command: ['postgres']
  entrypoint: ['/usr/bin/entrypoint.sh']
  ports:
    - 5432:5432


postgres:
  image: centos:7
  environment:
    - POSTGRES_DB=mydb
    - POSTGRES_USER=admin
    - POSTGRES_PASS=admin
    - PGDATA=/var/lib/pgsql/data
  user: postgres
  command: ['postgres']
  entrypoint: ['/usr/bin/entrypoint.sh']
  ports:
    - 5432:5432 
  # Uncomment the following to use an external volume or host mount
  # to store your database. Otherwise, the database will exist only
  # only while the container exists.
  # volumes:
  # - <external data volume>:/var/lib/pgsql/data

Add comment regarding data volume
Add comment regarding data volume