-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
150 lines (143 loc) · 3.91 KB
/
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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# This is a docker compose environment to bring up a dev/test fastdb
# environment
services:
postgres:
image: ${DOCKER_ARCHIVE:-registry.nersc.gov/m1727/raknop}/fastdb-postgres:${DOCKER_VERSION:-latest}
build:
context: ./docker/postgres
target: postgres
volumes:
- type: volume
source: postgres_data
target: /var/lib/postgresql/data
- type: bind
source: tests/secrets
target: /secrets
read_only: true
healthcheck:
test: netcat -w 1 localhost 5432 || exit 1
interval: 5s
timeout: 10s
retries: 5
createdb:
depends_on:
postgres:
condition: service_healthy
image: ${DOCKER_ARCHIVE:-registry.nersc.gov/m1727/raknop}/fastdb-shell:${DOCKER_VERSION:-latest}
build:
context: ./docker/webserver
target: shell
user: ${USERID:-0}:${GROUPID:-0}
volumes:
- type: bind
source: .
target: /code
working_dir: /code/db
entrypoint: [ "python", "apply_migrations.py" ]
mailhog:
image: mailhog/mailhog:latest
ports:
- "${MAILHOG_PORT:-8025}:8025"
queryrunner:
depends_on:
createdb:
condition: service_completed_successfully
image: ${DOCKER_ARCHIVE:-registry.nersc.gov/m1727/raknop}/fastdb-query-runner:${DOCKER_VERSION:-latest}
build:
context: ./docker/query_runner
target: queryrunner
user: ${USERID:-0}:${GROUPID:-0}
volumes:
- type: bind
source: tests/secrets
target: /secrets
read_only: true
- type: bind
source: install
target: /fastdb
- type: volume
source: query_results
target: /query_results
post_start:
- command: /bin/bash -c "chown -R ${USERID:-0}:${GROUPID:-0} /query_results"
privileged: true
user: root
webap:
depends_on:
createdb:
condition: service_completed_successfully
mailhog:
condition: service_started
queryrunner:
condition: service_started
image: ${DOCKER_ARCHIVE:-registry.nersc.gov/m1727/raknop}/fastdb-webap:${DOCKER_VERSION:-latest}
build:
context: ./docker/webserver
target: webserver
user: ${USERID:-0}:${GROUPID:-0}
ports:
- "${WEBPORT:-8080}:8080"
volumes:
- type: bind
source: tests/secrets
target: /secrets
read_only: true
- type: bind
source: .
target: /code
- type: bind
source: install
target: /fastdb
- type: volume
source: sessions
target: /sessions
- type: volume
source: query_results
target: /query_results
post_start:
- command: /bin/bash -c "
chown -R ${USERID:-0}:${GROUPID:-0} /sessions
&& chown -R ${USERID:-0}:${GROUPID:-0} /query_results
"
privileged: true
user: root
shell:
depends_on:
postgres:
condition: service_healthy
# createdb:
# condition: service_completed_successfully
image: ${DOCKER_ARCHIVE:-registry.nersc.gov/m1727/raknop}/fastdb-shell:${DOCKER_VERSION:-latest}
build:
context: ./docker/webserver
target: shell
user: ${USERID:-0}:${GROUPID:-0}
volumes:
- type: bind
source: tests/secrets
target: /secrets
read_only: true
- type: bind
source: .
target: /code
- type: bind
source: install
target: /fastdb
- type: volume
source: sessions
target: /sessions
- type: volume
source: query_results
target: /query_results
post_start:
- command: /bin/bash -c "
chown -R ${USERID:-0}:${GROUPID:-0} /sessions
&& chown -R ${USERID:-0}:${GROUPID:-0} /query_results
"
privileged: true
user: root
working_dir: /code
volumes:
postgres_data:
query_results:
sessions: