Skip to content

Commit a736a88

Browse files
committed
Initial commit
1 parent 655541d commit a736a88

File tree

4 files changed

+115
-2
lines changed

4 files changed

+115
-2
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Guillaume Simonneau
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,53 @@
1-
# postgres-docker-compose
2-
PostgreSQL and pgAdmin by Docker Compose
1+
# PostgreSQL and pgAdmin 4 by Docker Compose
2+
3+
## Requirements:
4+
* docker >= 17.12.0+
5+
* docker-compose
6+
7+
## Quick Start
8+
* Clone or download this repository
9+
* Go inside of directory, `cd postgres-docker-compose`
10+
* Run this command `docker-compose up -d`
11+
12+
13+
## Environments
14+
This Compose file contains the following environment variables:
15+
16+
* `POSTGRES_USER` the default value is **postgres**
17+
* `POSTGRES_PASSWORD` the default value is **setyourpassword**
18+
* `PGADMIN_PORT` the default value is **5050**
19+
* `PGADMIN_DEFAULT_EMAIL` the default value is **pgadmin4@pgadmin.org**
20+
* `PGADMIN_DEFAULT_PASSWORD` the default value is **admin**
21+
22+
## Access to postgres:
23+
* `localhost:5432`
24+
* **Username:** postgres
25+
* **Password:** setyourpassword
26+
27+
## Access to PgAdmin:
28+
* **URL:** [http://localhost:5050](http://localhost:5050)
29+
* **Username:** pgadmin@pgadmin.org
30+
* **Password:** admin
31+
32+
## Add a new server in PgAdmin:
33+
* **Host name/address** `postgres`
34+
* **Port** `5432`
35+
* **Username** as `POSTGRES_USER`, by default: `postgres`
36+
* **Password** as `POSTGRES_PASSWORD`, by default `setyourpassword`
37+
38+
![Alt text](register_server.png)
39+
40+
## Logging
41+
42+
There are no easy way to configure pgadmin log verbosity and it can be overwhelming at times. It is possible to disable pgadmin logging on the container level.
43+
44+
Add the following to `pgadmin` service in the `docker-compose.yml`:
45+
46+
```
47+
logging:
48+
driver: "none"
49+
```
50+
51+
## Are you new to PostgreSQL?
52+
53+
[Learn PostgreSQL Tutorial - Full Course for Beginners](https://www.youtube.com/watch?v=qw--VYLpxG4)

docker-compose.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: '3.5'
2+
3+
services:
4+
postgres:
5+
container_name: postgres_container
6+
image: postgres
7+
environment:
8+
POSTGRES_USER: ${POSTGRES_USER:-postgres}
9+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-setyourpassword}
10+
PGDATA: /data/postgres
11+
volumes:
12+
- postgres:/data/postgres
13+
ports:
14+
- "5432:5432"
15+
networks:
16+
- postgres
17+
restart: unless-stopped
18+
19+
pgadmin:
20+
container_name: pgadmin_container
21+
image: dpage/pgadmin4
22+
environment:
23+
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin@pgadmin.org}
24+
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
25+
PGADMIN_CONFIG_SERVER_MODE: 'False'
26+
volumes:
27+
- pgadmin:/var/lib/pgadmin
28+
29+
ports:
30+
- "${PGADMIN_PORT:-5050}:80"
31+
networks:
32+
- postgres
33+
restart: unless-stopped
34+
35+
networks:
36+
postgres:
37+
driver: bridge
38+
39+
volumes:
40+
postgres:
41+
pgadmin:

register_server.png

102 KB
Loading

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy