-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
54 lines (50 loc) · 1.56 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
version: '3.9'
services:
postgres_db:
container_name: postgres_container
image: "${POSTGRES_IMAGE:-postgres:latest}"
environment:
TZ: Etc/UTC
POSTGRES_INITDB_ARGS: '--locale=en_US.UTF-8 --encoding=UTF8'
POSTGRES_DB: ${POSTGRES_DB:-postgres}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
volumes:
- pgdata:/var/lib/postgresql/data
- ${POSTGRES_CONFIG_DIR:-./.config/postgres}/sql/30_postgres_initdb.sh:/docker-entrypoint-initdb.d/30_postgres_initdb.sh
ports:
- "${POSTGRES_PORT:-5432}:5432"
networks:
- env_net
restart: always
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-postgres} -h localhost"
]
interval: 30s
timeout: 5s
retries: 3
pgadmin:
container_name: pgadmin_container
image: "${PGADMIN_IMAGE:-dpage/pgadmin:latest}"
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-SuperSecret}
PGADMIN_CONFIG_SERVER_MODE: "${PGADMIN_CONFIG_SERVER_MODE:-True}"
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "${PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED:-True}"
volumes:
- pgadmin:/var/lib/pgadmin
- ${PGADMIN_CONFIG_DIR:-./.config/pgadmin4}/servers.json:/pgadmin4/servers.json
ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- env_net
restart: unless-stopped
networks:
env_net:
external: true
volumes:
pgdata:
pgadmin: