-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
31 lines (31 loc) · 1.09 KB
/
compose.yaml
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
services:
postgres:
container_name: postgres
image: postgres
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PW}
- POSTGRES_DB=${POSTGRES_DB} #optional (specify default database instead of $POSTGRES_DB)
ports:
- "5432:5432"
restart: always
volumes:
# The following scripts initialize a database with tables and values.
# copy the sql script to create tables
# - ./sqldata/create_db_tables_pg.sql:/docker-entrypoint-initdb.d/create_db_tables.sql
# copy the sql script to fill tables
# - ./sqldata/load_db_tables_pg.sql:/docker-entrypoint-initdb.d/load_db_tables_pg.sql
# Mount the directory to store the database on the host.
- ./pgdata:/var/lib/postgresql/data
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:latest
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_MAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PW}
ports:
- "5050:80"
restart: always
volumes:
# Mount the directory to store pgadmin user data.
- ./pgadmin:/var/lib/pgadmin