{"id":19737453,"url":"https://github.com/mkhuda/docker-postgresql-multidatabase","last_synced_at":"2026-04-10T02:13:13.406Z","repository":{"id":148890728,"uuid":"132638612","full_name":"mkhuda/docker-postgresql-multidatabase","owner":"mkhuda","description":"Create PostgreSQL Docker with Multiple Database (Prod, Dev, Test) Grant by postgres User","archived":false,"fork":false,"pushed_at":"2018-05-11T08:03:58.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T07:06:32.249Z","etag":null,"topics":["docker","docker-compose","dockerfile","postgresql","postgresql-database"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkhuda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-08T16:51:20.000Z","updated_at":"2021-09-14T14:15:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"d6fd742f-a7b3-4a0e-98bd-bc222f66a434","html_url":"https://github.com/mkhuda/docker-postgresql-multidatabase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhuda%2Fdocker-postgresql-multidatabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhuda%2Fdocker-postgresql-multidatabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhuda%2Fdocker-postgresql-multidatabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhuda%2Fdocker-postgresql-multidatabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkhuda","download_url":"https://codeload.github.com/mkhuda/docker-postgresql-multidatabase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241063000,"owners_count":19903006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","dockerfile","postgresql","postgresql-database"],"created_at":"2024-11-12T01:11:10.111Z","updated_at":"2025-12-31T01:13:20.993Z","avatar_url":"https://github.com/mkhuda.png","language":"Shell","readme":"# Docker Multiple Database for PostgreSQL\n\nBased on Postgresql 9.5 (Can be used to any versions) with Persistent Data.\n\n## Usage\n- Stop your current postgresql default system (If you have installed postgresql on PORT 5432):\n```\n$ sudo service postgresql stop\n```\n- Build the Dockerfile and compose it!\n\n```\n$ docker build -t postgres_multi .\n$ docker-compose up -d\n```\n\nIt will create 3 database for you `prod_db`, `dev_db`, and `test_db` within `postgres` User.\n\nIn order to test `psql` command, you can stop postgresql system by `sudo service postgresql stop` that uses PORT 5432.\n\nAnd then:\n\u003e Show created database\n\n```\n$ psql -h localhost -p 5432 -U postgres\nPassword for user postgres: \npsql (9.5.5, server 9.5.12)\nType \"help\" for help.\npostgres=# \\l\n                                 List of databases\n   Name    |  Owner   | Encoding |  Collate   |   Ctype    |   Access privileges   \n-----------+----------+----------+------------+------------+-----------------------\n dev_db    | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =Tc/postgres         +\n           |          |          |            |            | postgres=CTc/postgres\n postgres  | postgres | UTF8     | en_US.utf8 | en_US.utf8 | \n prod_db   | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =Tc/postgres         +\n           |          |          |            |            | postgres=CTc/postgres\n template0 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres          +\n           |          |          |            |            | postgres=CTc/postgres\n template1 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres          +\n           |          |          |            |            | postgres=CTc/postgres\n test_db   | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =Tc/postgres         +\n           |          |          |            |            | postgres=CTc/postgres\n(6 rows)\npostgres=# \\q\n```\n\n\u003e Use psql -d (database) option\n\n\u003e Show database table\n```\n$ psql -h localhost -p 5432 -U postgres -d prod_db\n```\n\n\u003e Use docker exec, See container ID before by 'docker ps' command\n\n```\n$ docker ps\n$ docker exec -it [container-id] bash\n$ psql -U postgres\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkhuda%2Fdocker-postgresql-multidatabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkhuda%2Fdocker-postgresql-multidatabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkhuda%2Fdocker-postgresql-multidatabase/lists"}