Skip to content

Commit d078243

Browse files
committed
init
1 parent 5ab3a0b commit d078243

File tree

5 files changed

+47
-2
lines changed

5 files changed

+47
-2
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
DB_PORT=25432
2+
DB_USERNAME=postgres
3+
DB_PASSWORD=postgres
4+
DB_NAME=sample

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
resources

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# READ ME
1+
# docker-compose-postgres
22

33
learn site: <https://www.postgresqltutorial.com/postgresql-sample-database/>
4-
# docker-compose-postgres

docker-compose.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: '3.7'
2+
services:
3+
postgres:
4+
# hostname: pgsql
5+
# container_name: pgsql
6+
image: "postgres:alpine"
7+
# image: postgres:11-alpine
8+
# image: postgres:10-alpine
9+
# image: postgres:9.6-alpine
10+
environment:
11+
#POSTGRES_HOST_AUTH_METHOD: "trust"
12+
#POSTGRES_DB: ${DB_NAME:-sample}
13+
POSTGRES_USER: ${DB_USERNAME:-postgres}
14+
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
15+
volumes:
16+
- pgsqldata:/var/lib/postgresql/data
17+
ports:
18+
- "${DB_PORT:-25432}:5432"
19+
healthcheck:
20+
test: ["CMD-SHELL", "pg_isready -U postgres"]
21+
interval: 10s
22+
timeout: 5s
23+
retries: 5
24+
# restart: always
25+
restart: unless-stopped
26+
27+
pgadmin:
28+
container_name: pgadmin_container
29+
image: dpage/pgadmin4
30+
environment:
31+
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
32+
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
33+
volumes:
34+
- pgadmin:/root/.pgadmin
35+
ports:
36+
- "${PGADMIN_PORT:-5050}:80"
37+
restart: unless-stopped
38+
39+
volumes:
40+
pgsqldata:
41+
pgadmin:

scripts/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)