Guest User

Untitled

a guest
Feb 2nd, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. mkdir postgres
  4. cd postgres
  5.  
  6. docker volume create --driver local --name=pgvolume
  7. docker volume create --driver local --name=pga4volume
  8.  
  9. docker network create --driver bridge pgnetwork
  10.  
  11. cat << EOF > pg-env.list
  12. PG_MODE=primary
  13. PG_PRIMARY_USER=postgres
  14. PG_PRIMARY_PASSWORD=yoursecurepassword
  15. PG_DATABASE=testdb
  16. PG_USER=yourusername
  17. PG_PASSWORD=yoursecurepassword
  18. PG_ROOT_PASSWORD=yoursecurepassword
  19. PG_PRIMARY_PORT=5432
  20. EOF
  21.  
  22. cat << EOF > pgadmin-env.list
  23. PGADMIN_SETUP_EMAIL=youremail@yourdomain.com
  24. PGADMIN_SETUP_PASSWORD=yoursecurepassword
  25. SERVER_PORT=5050
  26. EOF
  27.  
  28. docker run --publish 5432:5432 \
  29. --volume=pgvolume:/pgdata \
  30. --env-file=pg-env.list \
  31. --name="postgres" \
  32. --hostname="postgres" \
  33. --network="pgnetwork" \
  34. --detach \
  35. crunchydata/crunchy-postgres:centos7-10.5-2.1.0
  36.  
  37. docker run --publish 5050:5050 \
  38. --volume=pga4volume:/var/lib/pgadmin \
  39. --env-file=pgadmin-env.list \
  40. --name="pgadmin4" \
  41. --hostname="pgadmin4" \
  42. --network="pgnetwork" \
  43. --detach \
  44. crunchydata/crunchy-pgadmin4:centos7-10.5-2.1.0
Add Comment
Please, Sign In to add comment