Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
193 lines (183 loc) · 5.88 KB
/
Copy pathdocker-compose.yml
File metadata and controls
193 lines (183 loc) · 5.88 KB
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
services:
redis:
image: redis:7-alpine
restart: always
command: redis-server --appendonly no
networks:
- storenetwork
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
volumes:
- redis_data:/data
clickhouse:
image: clickhouse/clickhouse-server:26.3.17.110
profiles: ["analytics"]
restart: unless-stopped
networks:
- storenetwork
environment:
CLICKHOUSE_DB: ${CLICKHOUSE_DATABASE:-lunastore_analytics}
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-analytics}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-analytics}
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: "1"
volumes:
- clickhouse_data:/var/lib/clickhouse
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8123/ping || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
db:
image: postgres:18-alpine
container_name: lunastore_db
restart: unless-stopped
env_file:
- .env
environment:
POSTGRES_DB: ${DB_NAME:-lunastore}
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD}
PGDATA: /var/lib/postgresql/data/pgdata
networks:
- storenetwork
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-lunastore}",
]
interval: 5s
timeout: 5s
retries: 5
meilisearch:
image: getmeili/meilisearch:v1.53
restart: unless-stopped
networks:
- storenetwork
environment:
MEILI_ENV: production
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY}
# Allows in-place DB upgrade when the Meilisearch image version changes.
MEILI_UPGRADE_DB: "true"
volumes:
- meili_data:/meili_data
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --spider http://127.0.0.1:7700/health || exit 1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 120s
lunaspire:
build: ./lunaspire/
image: lunaspire:local
env_file:
- ./lunaspire/.env
restart: unless-stopped
networks:
- storenetwork
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./lunaspire/public:/root/public
- /mnt/data/lunaspire/storage:/root/storage
ports:
- "6080:8080"
command: >
sh -c "./main"
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
x-lunastore-template: &lunastore_base
build: .
image: lunastore:local
env_file:
- .env
restart: unless-stopped
networks:
- storenetwork
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
lunaspire:
condition: service_healthy
meilisearch:
condition: service_healthy
volumes:
- /opt/lunastore/static:/app/static
- /opt/lunastore/media:/app/media
- /opt/lunastore/certs:/app/certs:ro
command: >
sh -c "python manage.py collectstatic --noinput && (
DJANGO_ROOT_URLCONF=lunastore.urls_api gunicorn lunastore.wsgi:application --bind 0.0.0.0:7088 --workers 5 &
DJANGO_ROOT_URLCONF=lunastore.urls_private gunicorn lunastore.wsgi:application --bind 0.0.0.0:8088 --workers 5 &
DJANGO_ROOT_URLCONF=lunastore.urls gunicorn lunastore.wsgi:application --bind 0.0.0.0:9088 --workers 5 &
wait
)"
healthcheck:
test:
[
"CMD-SHELL",
"curl -fs http://127.0.0.1:7088/method/service/heartbeat/ && curl -fs http://127.0.0.1:8088/${ADMIN_URL:-admin}/login/ && curl -fs http://127.0.0.1:9088/ || exit 1",
]
interval: 10s
retries: 3
start_period: 60s
lunastore-blue:
<<: *lunastore_base
container_name: lunastore_blue
ports:
- "127.0.0.1:7081:7088" # API
- "127.0.0.1:8081:8088" # Admin
- "127.0.0.1:9081:9088" # Web
lunastore-green:
<<: *lunastore_base
container_name: lunastore_green
ports:
- "127.0.0.1:7082:7088"
- "127.0.0.1:8082:8088"
- "127.0.0.1:9082:9088"
lunastore-worker:
build: .
image: lunastore:local
container_name: lunastore_worker
restart: unless-stopped
networks:
- storenetwork
env_file:
- .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
lunaspire:
condition: service_healthy
volumes:
- /opt/lunastore/media:/app/media
- /opt/lunastore/certs:/app/certs:ro
command: python manage.py run_tasks_worker --continuous --interval 1.0
networks:
storenetwork:
name: lunastore_network
driver: bridge
volumes:
media_volume:
pg_data:
redis_data:
clickhouse_data:
meili_data: