|
|
4 жил өмнө | |
|---|---|---|
| .. | ||
| .env | 4 жил өмнө | |
| README.md | 4 жил өмнө | |
| docker-compose.yaml | 4 жил өмнө | |
This example provides a base setup for using PostgreSQL and pgAdmin. More details on how to customize the installation and the compose file can be found here (PostgreSQL) and here (pgAdmin).
Project structure:
.
├── .env
├── docker-compose.yaml
└── README.md
services:
postgres:
image: postgres:latest
...
pgadmin:
image: dpage/pgadmin4:latest
Before deploying this setup, you need to configure the following values in the .env file.
When deploying this setup, the pgAdmin web interface will be available at port 5050 (e.g. http://localhost:5050).
$ docker-compose up
Starting postgres ... done
Starting pgadmin ... done
After logging in with your credentials of the .env file, you can add your database to pgAdmin.
Check containers are running:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
849c5f48f784 postgres:latest "docker-entrypoint.s…" 9 minutes ago Up 9 minutes 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp postgres
d3cde3b455ee dpage/pgadmin4:latest "/entrypoint.sh" 9 minutes ago Up 9 minutes 443/tcp, 0.0.0.0:5050->80/tcp, :::5050->80/tcp pgadmin
Stop the containers with
$ docker-compose down
# To delete all data run:
$ docker-compose down -v