-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yml
189 lines (173 loc) · 4.49 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
version: '3'
services:
wait:
# just use same image as another container, no extra download
image: node:16
command: >
sh -c "
echo 'Waiting for database...' &&
wait-for-it -q -t 0 db:5432 &&
echo '... database ready' &&
echo 'Waiting for backend...' &&
wait-for-it -q -t 0 backend:8000 &&
echo '... backend ready' &&
echo 'Waiting for frontend...' &&
wait-for-it -q -t 0 frontend:8080 &&
echo '... frontend ready' &&
echo 'All ready! Go and visit http://localhost:8080 :)'
"
volumes:
- ./docker/wait/wait-for-it:/usr/local/bin/wait-for-it
frontend:
image: node:16
restart: unless-stopped
command: >
sh -c "
yarn &&
yarn dev -m pwa
"
environment:
HOST: 0.0.0.0
BACKEND: ${BACKEND:-http://backend:8000}
NAME: frontend
TERM: ${TERM:-}
SHELL: /bin/bash
expose:
- 8080
ports:
- 8080:8080
- 6006:6006
volumes:
- ./karrot-frontend:/app
- ./docker/frontend/.env:/app/.env
- ./docker/common/.bashrc:/root/.bashrc
- node_modules:/app/node_modules
- yarn-cache:/usr/local/share/.cache/yarn
working_dir: /app
backend:
image: karrot/python:2.11
restart: unless-stopped
command: >
bash -c "
(test -d env/bin || virtualenv --python=python3 --no-site-packages env) &&
(test -f env/bin/pip-sync || env/bin/pip install pip-tools) &&
source env/bin/activate &&
./sync.py --no-mjml --no-hooks &&
./manage.py migrate &&
./manage.py runserver 0.0.0.0:8000
"
ports:
- 8000:8000
volumes:
- ./karrot-backend:/app
- ./docker/backend/local_settings.py:/app/config/local_settings.py
- ./docker/common/.bashrc:/root/.bashrc
- virtualenv:/app/env
- pip-cache:/root/.cache/pip/
env_file:
- ./docker/backend/.env
environment:
PYTHONUNBUFFERED: 1
PATH: /app/env/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NAME: backend
TERM: ${TERM:-}
SHELL: /bin/bash
LC_ALL: C.UTF-8
LANG: C.UTF-8
FCM_SERVER_KEY: ${FCM_SERVER_KEY:-}
# so you can override with docker compose .env config...
SITE_URL: ${SITE_URL:-http://localhost:8080}
working_dir: /app
huey:
image: karrot/python:2.11
restart: unless-stopped
command: >
sh -c "
wait-for-it -q -t 0 backend:8000 &&
find karrot -name '*.py' | entr -r env/bin/python manage.py run_huey
"
volumes:
- ./karrot-backend:/app
- ./docker/backend/local_settings.py:/app/config/local_settings.py
- virtualenv:/app/env
- pip-cache:/root/.cache/pip/
- ./docker/wait/wait-for-it:/usr/local/bin/wait-for-it
env_file:
- ./docker/backend/.env
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8
FCM_SERVER_KEY: ${FCM_SERVER_KEY:-}
SITE_URL: ${SITE_URL:-http://localhost:8080}
working_dir: /app
depends_on:
- backend
db:
build: docker/db
restart: unless-stopped
ports:
- 15432:5432
volumes:
- database-v3:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: db
POSTGRES_USER: db
POSTGRES_DB: db
mjml:
image: node:16
restart: unless-stopped
working_dir: /app/mjml
command: sh -c 'yarn && ./convert --watch'
ports:
- 8001:8001
volumes:
- ./karrot-backend:/app
- mjml-node_modules:/app/mjml/node_modules
redis:
image: redis:6.2.6-alpine
restart: unless-stopped
influxdb:
image: influxdb:1.7.11-alpine
restart: unless-stopped
ports:
- 8083:8083
- 8086:8086
environment:
INFLUXDB_ADMIN_ENABLED: "true"
INFLUXDB_DB: "fstool"
volumes:
- influxdb:/var/lib/influxdb
- ./docker/influxdb/influxdb.toml:/etc/influxdb/influxdb.toml
grafana:
image: grafana/grafana:8.2.6
restart: unless-stopped
ports:
- 4000:3000
volumes:
- grafana:/var/lib/grafana
maildev:
image: maildev/maildev:1.1.0
restart: unless-stopped
ports:
- 1080:80
pgweb:
image: sosedoff/pgweb:0.11.9
restart: unless-stopped
ports:
- 5050:8081
environment:
DATABASE_URL: postgres://db:db@db:5432/db?sslmode=disable
links:
- db
depends_on:
- db
volumes:
virtualenv:
pip-cache:
yarn-cache:
node_modules:
mjml-node_modules:
database-v3:
name: ${DB_VOLUME_NAME:-database-v3}
influxdb:
grafana: