-
create a github codespace
-
add the compose file
-
run
docker compose up
-
visit the forwarded port for 5050 and setup your connection inside pgadmin4 after logging in
Created
October 7, 2023 13:25
-
-
Save chill-cod3r/80fbf7780349be7fc39d8768edf3f4f7 to your computer and use it in GitHub Desktop.
docker compose file for starting postgres and pgadmin
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.8' | |
services: | |
db: | |
container_name: pg_container | |
image: postgres | |
restart: always | |
environment: | |
POSTGRES_USER: root | |
POSTGRES_PASSWORD: root | |
POSTGRES_DB: postgres | |
volumes: | |
- ./data/pg:/var/lib/postgresql/data | |
ports: | |
- "5432:5432" | |
pgadmin: | |
container_name: pgadmin4_container | |
image: dpage/pgadmin4 | |
restart: always | |
environment: | |
PGADMIN_DEFAULT_EMAIL: admin@admin.com | |
PGADMIN_DEFAULT_PASSWORD: root | |
PGADMIN_CONFIG_PROXY_X_HOST_COUNT: 1 | |
PGADMIN_CONFIG_PROXY_X_PREFIX_COUNT: 1 | |
volumes: | |
- ./data/pgadmin:/var/lib/pgadmin | |
ports: | |
- "5050:80" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment