Created
October 27, 2019 15:20
-
-
Save tingwei628/8584ddefc5d8e85f73566d5ab96bdc84 to your computer and use it in GitHub Desktop.
use postgresql and pgAdmin in docker
This file contains hidden or 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.4" | |
services: | |
pgAdmin: | |
restart: always | |
image: dpage/pgadmin4 | |
ports: | |
- "8000:80" | |
environment: | |
PGADMIN_DEFAULT_EMAIL: [email protected] | |
PGADMIN_DEFAULT_PASSWORD: 1234 | |
volumes: | |
- pgadmin:/var/lib/pgadmin | |
postgres: | |
restart: always | |
image: postgres | |
container_name: "postgres_container" | |
ports: | |
- "5432:5432" | |
environment: | |
POSTGRES_USER: me | |
POSTGRES_PASSWORD: 1234 | |
POSTGRES_DB: testDb | |
volumes: | |
- pgvol:/var/lib/postgresql/data | |
volumes: | |
pgvol: | |
pgadmin: |
@silvesterkkk, you can use relative paths as well.
https://stackoverflow.com/questions/54322675/relative-path-binding-in-docker-for-volumes-in-macos-does-fail
Thank you, appreciate getting back to me.
UPDATE
I wrote a new article on Setting Up CloudNativePG on KIND with pgAdmin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi, not sure if this is forum for a question, if not please let me know.
I am new to docker, and wonder if those host volumes (i.e. pgvol & pgadmin) are relative paths?