-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.multi-service.dev.yml
196 lines (184 loc) · 6.52 KB
/
docker-compose.multi-service.dev.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
190
191
192
193
194
195
196
version: "3.4"
# MAKE SURE YOU HAVE SET THE REQUIRED VARIABLES IN the .env FILE.configs:
# This compose file starts up a dev version of the plugin with hot code reloading.
# It is accessible at http://localhost:3000 .
services:
# A caddy http server just used for serving media in dev.
caddy:
image: caddy:2
env_file:
- .env
ports:
- "${HOST_PUBLISH_IP:-127.0.0.1}:4000:80"
volumes:
# Override with the dev caddy file which switches Caddy to only be the media file
# server in the dev env. Devs will instead directly connect to the backend and
# web frontend services.
- $PWD/Caddyfile.dev:/etc/caddy/Caddyfile
- media:/baserow/media
- caddy_config:/config
- caddy_data:/data
backend:
image: basecharts_backend_dev
build:
dockerfile: ./backend-dev.Dockerfile
context: .
args:
# We allow configuring the PLUGIN_BUILD_UID/PLUGIN_BUILD_GID here so you can run as the dev's actual user
# reducing the chance the containers screw up the bind mounted folders.
PLUGIN_BUILD_UID: $PLUGIN_BUILD_UID
PLUGIN_BUILD_GID: $PLUGIN_BUILD_GID
environment:
# Dev override variables
- PUBLIC_BACKEND_URL=http://localhost:8000
- PUBLIC_WEB_FRONTEND_URL=http://localhost:3000
- MEDIA_URL=http://localhost:4000/
- BASEROW_PUBLIC_URL=
- BASEROW_BACKEND_DEBUGGER_ENABLED=${BASEROW_BACKEND_DEBUGGER_ENABLED:-True}
- BASEROW_BACKEND_DEBUGGER_PORT=${BASEROW_BACKEND_DEBUGGER_PORT:-5678}
ports:
- "${HOST_PUBLISH_IP:-127.0.0.1}:8000:8000"
- "${HOST_PUBLISH_IP:-127.0.0.1}:${BASEROW_BACKEND_DEBUGGER_PORT:-5678}:${BASEROW_BACKEND_DEBUGGER_PORT:-5678}"
env_file:
- .env
depends_on:
- db
- redis
volumes:
- media:/baserow/media
- ./plugins/basecharts/backend:/baserow/plugins/basecharts/backend
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
web-frontend:
image: basecharts_web-frontend_dev
build:
dockerfile: ./web-frontend-dev.Dockerfile
context: .
args:
# We allow configuring the PLUGIN_BUILD_UID/PLUGIN_BUILD_GID here so you can run as the dev's actual user
# reducing the chance the containers screw up the bind mounted folders.
PLUGIN_BUILD_UID: $PLUGIN_BUILD_UID
PLUGIN_BUILD_GID: $PLUGIN_BUILD_GID
environment:
- PUBLIC_BACKEND_URL=http://localhost:8000
- PUBLIC_WEB_FRONTEND_URL=http://localhost:3000
- MEDIA_URL=http://localhost:4000/
- BASEROW_PUBLIC_URL=
ports:
- "${HOST_PUBLISH_IP:-127.0.0.1}:3000:3000"
env_file:
- .env
depends_on:
- backend
volumes:
# Override the for node_modules so we use the node_modules built
# directly into the image instead of whatever is on your local filesystem.
- /baserow/plugins/basecharts/web-frontend/node_modules
- ./plugins/basecharts/web-frontend:/baserow/plugins/basecharts/web-frontend
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
celery:
image: basecharts_backend_dev
env_file:
.env
command: celery-worker
# The backend image's baked in healthcheck defaults to the django healthcheck
# override it to the celery one here.
healthcheck:
test: [ "CMD-SHELL", "/baserow/backend/docker/docker-entrypoint.sh celery-worker-healthcheck" ]
environment:
# Dev override variables
- PUBLIC_BACKEND_URL=http://localhost:8000
- PUBLIC_WEB_FRONTEND_URL=http://localhost:3000
- MEDIA_URL=http://localhost:4000/
- BASEROW_PUBLIC_URL=
depends_on:
- backend
volumes:
- media:/baserow/media
- ./plugins/basecharts/backend:/baserow/plugins/basecharts/backend
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
celery-export-worker:
image: basecharts_backend_dev
command: celery-exportworker
# The backend image's baked in healthcheck defaults to the django healthcheck
# override it to the celery one here.
healthcheck:
test: [ "CMD-SHELL", "/baserow/backend/docker/docker-entrypoint.sh celery-exportworker-healthcheck" ]
environment:
# Dev override variables
- PUBLIC_BACKEND_URL=http://localhost:8000
- PUBLIC_WEB_FRONTEND_URL=http://localhost:3000
- MEDIA_URL=http://localhost:4000/
- BASEROW_PUBLIC_URL=
depends_on:
- backend
env_file:
.env
volumes:
- media:/baserow/media
- ./plugins/basecharts/backend:/baserow/plugins/basecharts/backend
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
celery-beat-worker:
image: basecharts_backend_dev
command: celery-beat
# See https://github.com/sibson/redbeat/issues/129#issuecomment-1057478237
stop_signal: SIGQUIT
environment:
# Dev override variables
- PUBLIC_BACKEND_URL=http://localhost:8000
- PUBLIC_WEB_FRONTEND_URL=http://localhost:3000
- MEDIA_URL=http://localhost:4000/
- BASEROW_PUBLIC_URL=
env_file:
- .env
depends_on:
- backend
volumes:
- media:/baserow/media
- ./plugins/basecharts/backend:/baserow/plugins/basecharts/backend
# Open stdin and tty so when attaching key input works as expected.
stdin_open: true
tty: true
db:
# Please ensure the postgres-client's major version in the backend image is kept in
# sync with this major version so pg_dump remains compatible.
image: postgres:11
env_file:
- .env
environment:
- POSTGRES_USER=${DATABASE_USER:-baserow}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD:?}
- POSTGRES_DB=${DATABASE_NAME:-baserow}
healthcheck:
test: [ "CMD-SHELL", "su postgres -c \"pg_isready -U ${DATABASE_USER:-baserow}\"" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:6
command: redis-server --requirepass ${REDIS_PASSWORD:?}
env_file:
- .env
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
# By default, the media volume will be owned by root on startup. Ensure it is owned by
# the same user that django is running as, so it can write user files.
volume-permissions-fixer:
image: bash:4.4
command: chown ${PLUGIN_BUILD_UID:-1000}:${PLUGIN_BUILD_GID:-1000} -R /baserow/media
volumes:
- media:/baserow/media
volumes:
pgdata:
media:
caddy_data:
caddy_config: