Last active
July 4, 2022 04:13
-
-
Save sgyyz/1012e697542ccd3d5e3fe71bc7f98521 to your computer and use it in GitHub Desktop.
Postgres & PgAdmin docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
postgres: | |
image: postgres | |
ports: | |
- "5432:5432" | |
volumes: | |
- pg-dataset:/var/lib/postgresql/data | |
environment: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: | |
pgadmin: | |
image: dpage/pgadmin4 | |
depends_on: | |
- postgres | |
ports: | |
- "53603:53603" | |
- "80:80" | |
environment: | |
PGADMIN_DEFAULT_EMAIL: [email protected] | |
PGADMIN_DEFAULT_PASSWORD: root | |
volumes: | |
pg-dataset: |
Thank you for this. I am using a similar setup, but I am not able to login to pgadmin. Seems it uses a default user and password I am not aware of, and ignores the one I specified in the environments.
I created a StackOverflow question here, in case you want to look at the details.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to run it?
Copy these content into your
docker-compose.yml
file and then run the docker throughdocker-compose up
ordocker-compose up -d
.Configuration
It's better to update configuration based on your own environment. And follow the guide for
postgres
anddpage/pgadmin4
.Use it
http://localhost
dpage/pgadmin4
indocker-compose.yml
postgres
, username:postgres
, password: empty