-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.multi-service.yml
132 lines (120 loc) · 3.49 KB
/
docker-compose.multi-service.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
version: "3.4"
# MAKE SURE YOU HAVE SET THE REQUIRED VARIABLES IN the .env FILE.configs:
# This compose file starts up a prodish version of the plugin using a caddy reverse
# proxy to route requests between the backend and web-frontend services.
# It is accessible at http://localhost:80 by default.
services:
# A caddy reverse proxy sitting in-front of all the services.
caddy:
image: caddy:2
restart: unless-stopped
env_file:
- .env
ports:
- "${HOST_PUBLISH_IP:-0.0.0.0}:${WEB_FRONTEND_PORT:-80}:80"
- "${HOST_PUBLISH_IP:-0.0.0.0}:${WEB_FRONTEND_SSL_PORT:-443}:443"
volumes:
- $PWD/Caddyfile:/etc/caddy/Caddyfile
- media:/baserow/media
- caddy_config:/config
- caddy_data:/data
backend:
image: basescript_backend
build:
dockerfile: ./backend.Dockerfile
context: .
restart: unless-stopped
env_file:
- .env
depends_on:
- db
- redis
volumes:
- media:/baserow/media
web-frontend:
image: basescript_web-frontend
build:
dockerfile: ./web-frontend.Dockerfile
context: .
restart: unless-stopped
env_file:
- .env
depends_on:
- backend
celery:
image: basescript_backend
restart: unless-stopped
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" ]
depends_on:
- backend
volumes:
- media:/baserow/media
celery-export-worker:
image: basescript_backend
restart: unless-stopped
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" ]
depends_on:
- backend
env_file:
.env
volumes:
- media:/baserow/media
celery-beat-worker:
image: basescript_backend
restart: unless-stopped
command: celery-beat
# See https://github.com/sibson/redbeat/issues/129#issuecomment-1057478237
stop_signal: SIGQUIT
env_file:
- .env
depends_on:
- backend
volumes:
- media:/baserow/media
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:15
restart: unless-stopped
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 9999:9999 -R /baserow/media
volumes:
- media:/baserow/media
volumes:
pgdata:
media:
caddy_data:
caddy_config: