-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
110 lines (103 loc) · 2.79 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
version: "3.8"
services:
postgres:
image: "postgres:12"
restart: "unless-stopped"
command: "postgres -c config_file=/etc/postgresql.conf"
environment:
POSTGRES_PASSWORD: "${PGPASSWORD:-postgres}"
volumes:
- "postgres-data-dir:/var/lib/postgresql/data"
- "./conf/postgresql.conf:/etc/postgresql.conf"
init-db:
image: "jupyter-beefed-up:latest"
depends_on:
- "postgres"
# Run the script successfully at most once.
restart: "on-failure"
command: "/init-db.sh"
secrets:
- "pgpassfile"
environment:
PGHOST: "postgres"
PGPORT: 5432
PGUSER: "postgres"
PGDATABASE: "postgres"
PGPASSFILE: "/run/secrets/pgpassfile"
# init-exercises tries to download the dumps only if DO_INIT_DB
# is true.
DO_INIT_DB: "${DO_INIT_DB:-true}"
volumes:
- "./scripts/init-db.sh:/init-db.sh"
init-exercises:
image: "jupyter-beefed-up:latest"
depends_on:
- "jupyter"
# Run the script successfully at most once.
restart: "on-failure"
command: "/init-exercises.sh"
secrets:
- "pgpassfile"
environment:
PGHOST: "postgres"
PGPORT: 5432
PGUSER: "postgres"
PGDATABASE: "postgres"
PGPASSFILE: "/run/secrets/pgpassfile"
# init-exercises tries to download the exercises only if DO_INIT_EXERCISES
# is true.
DO_INIT_EXERCISES: "${DO_INIT_EXERCISES:-true}"
volumes:
- "./scripts/init-exercises.sh:/init-exercises.sh"
- "./exercises:/exercises"
pgadmin:
image: "dpage/pgadmin4:4.25"
depends_on:
- "postgres"
restart: "unless-stopped"
secrets:
- "pgpassfile"
environment:
PGADMIN_DEFAULT_EMAIL: "${PGADMIN_DEFAULT_EMAIL:[email protected]}"
PGADMIN_DEFAULT_PASSWORD: "${PGADMIN_DEFAULT_PASSWORD:-test}"
expose:
- "80"
volumes:
- "./conf/pgadmin4-servers.json:/pgadmin4/servers.json"
jupyter:
image: "jupyter-beefed-up:latest"
build:
context: "./docker"
dockerfile: "jupyter.Dockerfile"
depends_on:
- "postgres"
restart: "unless-stopped"
secrets:
- "pgpassfile"
environment:
PGHOST: "postgres"
PGPORT: 5432
PGUSER: "${POSTGRES_USER:-postgres}"
PGDATABASE: "${POSTGRES_DB:-postgres}"
PGPASSFILE: "/run/secrets/pgpassfile"
JUPYTER_TOKEN: "${PGPASSWORD:-postgres}"
RESTARTABLE: "yes"
DATABASE_URL: "${DATABASE_URL:-postgres://postgres:postgres@postgres:5432/postgres}"
volumes:
- "./exercises:/home/jovyan"
nginx:
build:
context: "./docker"
dockerfile: "nginx.Dockerfile"
ports:
- "80:80"
- "443:443"
depends_on:
- "jupyter"
restart: "unless-stopped"
secrets:
pgpassfile:
file: "./pgpassfile"
volumes:
postgres-data-dir: