-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpostgres-docker-compose.yaml
57 lines (54 loc) · 1.16 KB
/
postgres-docker-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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
version: "3.8"
# Optional Jupyter Notebook service
services:
jupyter_notebook:
image: "jupyter/minimal-notebook"
container_name: jupyter_notebook
environment:
JUPYTER_ENABLE_LAB: "yes"
ports:
- "8888:8888"
volumes:
- /home/mmphego/tmp/dataeng:/home/jovyan/work
depends_on:
- database
links:
- database
networks:
- etl_network
database:
image: "postgres:11"
container_name: database
ports:
- "5432:5432"
expose:
- "5432"
environment:
POSTGRES_DB: "winequality"
POSTGRES_HOST: "database"
POSTGRES_PASSWORD: "postgres"
POSTGRES_PORT: "5432"
POSTGRES_USER: "postgres"
healthcheck:
test:
[
"CMD",
"pg_isready",
"-U",
"postgres",
"-d",
"winequality"
]
interval: 5s
retries: 5
restart: always
volumes:
- /tmp/pg-data/:/var/lib/postgresql/data/
- ./init-db.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- etl_network
volumes:
dbdata: null
# Create custom network for bridging the containers
networks:
etl_network: null