Postgresql & PgAdmin powered by compose
https://github.com/fanqingsong/compose-postgres/blob/master/docker-compose.yml
Quick Start
- Clone or download this repository
- Go inside of directory,
cd compose-postgres
- Run this command
docker-compose up -d
Environments
This Compose file contains the following environment variables:
POSTGRES_USER
the default value is postgresPOSTGRES_PASSWORD
the default value is changemePGADMIN_PORT
the default value is 5050PGADMIN_DEFAULT_EMAIL
the default value is [email protected]PGADMIN_DEFAULT_PASSWORD
the default value is adminAccess to postgres:
localhost:5432
- Username: postgres (as a default)
- Password: changeme (as a default)
Access to PgAdmin:
- URL:
http://localhost:5050
- Username: [email protected] (as a default)
- Password: admin (as a default)
Add a new server in PgAdmin:
- Host name/address
postgres
- Port
5432
- Username as
POSTGRES_USER
, by default:postgres
- Password as
POSTGRES_PASSWORD
, by defaultchangeme
version: '3.5' services: postgres: container_name: postgres_container image: postgres environment: POSTGRES_USER: ${POSTGRES_USER:-postgres} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} PGDATA: /data/postgres volumes: - postgres:/data/postgres ports: - "5432:5432" networks: - postgres restart: unless-stopped pgadmin: container_name: pgadmin_container image: dpage/pgadmin4 environment: PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]} PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin} PGADMIN_CONFIG_SERVER_MODE: 'False' volumes: - pgadmin:/var/lib/pgadmin ports: - "${PGADMIN_PORT:-5050}:80" networks: - postgres restart: unless-stopped networks: postgres: driver: bridge volumes: postgres: pgadmin:
标签:compose,Postgresql,PgAdmin,default,POSTGRES,PGADMIN,pgadmin,postgres From: https://www.cnblogs.com/lightsong/p/18327241