-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
245 lines (234 loc) · 6.28 KB
/
Copy pathdocker-compose.yml
File metadata and controls
245 lines (234 loc) · 6.28 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
services:
# (~) Database
database-postgres:
profiles: ["db-postgres"]
image: postgres:17-alpine
environment:
POSTGRES_DB: ${DB_NAME:-appdb}
POSTGRES_USER: ${DB_USER:-appuser}
POSTGRES_PASSWORD: ${DB_PASSWORD:-apppass}
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./infrastructure/database/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./logs/postgres:/var/log/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-appuser} -d ${DB_NAME:-appdb}"]
interval: 5s
timeout: 5s
retries: 5
networks:
internal-net:
aliases:
- database
database-mysql:
profiles: ["db-mysql"]
image: mysql:8.4
environment:
MYSQL_DATABASE: ${DB_NAME:-appdb}
MYSQL_USER: ${DB_USER:-appuser}
MYSQL_PASSWORD: ${DB_PASSWORD:-apppass}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-rootpass}
ports:
- "${DB_PORT:-3306}:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./infrastructure/database/init-mysql.sql:/docker-entrypoint-initdb.d/init.sql
- ./logs/mysql:/var/log/mysql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -uroot -p${DB_ROOT_PASSWORD:-rootpass}"]
interval: 5s
timeout: 5s
retries: 10
networks:
internal-net:
aliases:
- database
# (~) RabbitMQ
rabbitmq:
profiles: ["queue"]
image: rabbitmq:3.13-management-alpine
container_name: rabbitmq
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-queue_user}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-queue_password}
ports:
- "5672:5672"
- "15672:15672"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
- ./logs/rabbitmq:/var/log/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- internal-net
# (~) Frontend
frontend:
profiles: [ "frontend" ]
container_name: b24-ai-starter-frontend
build:
context: ./frontend
dockerfile: Dockerfile
target: ${BUILD_TARGET:-dev}
env_file: .env
environment:
NUXT_PUBLIC_APP_URL: ${VIRTUAL_HOST}
NUXT_PUBLIC_API_URL: ${VIRTUAL_HOST}
NUXT_PUBLIC_TELEMETRY_ENABLED: ${TELEMETRY_ENABLED:-false}
HTTP: frontend:3000
expose:
- '3000'
# ports:
# - "127.0.0.1:3000:3000"
volumes:
- ./frontend:/app
networks:
- internal-net
# (~) Cloudpub - public tunnel
cloudpub:
profiles: ["cloudpub"]
container_name: b24-ai-starter-cloudpub
image: ${CLOUDPUB_IMAGE:-cloudpub/cloudpub:latest}
platform: ${CLOUDPUB_PLATFORM:-linux/amd64}
restart: unless-stopped
env_file: .env
environment:
TOKEN: ${CLOUDPUB_TOKEN}
HTTP: ${CLOUDPUB_HTTP_TARGET:-api-php:8000}
command: run
depends_on:
- api-php
volumes:
- cloudpub-config:/home/cloudpub
networks:
- internal-net
# (~) API servers (selected via profile)
api-php:
profiles: ["php"]
build:
context: ./backends/php
dockerfile: docker/php-fpm/Dockerfile
container_name: api
env_file: .env
environment:
DB_HOST: database
NODE_ENV: ${NODE_ENV:-development}
NUXT_PUBLIC_API_URL: ${VIRTUAL_HOST}
BITRIX24_PHP_SDK_APPLICATION_CLIENT_ID: ${CLIENT_ID:-enter_your_b24_app_client_id}
BITRIX24_PHP_SDK_APPLICATION_CLIENT_SECRET: ${CLIENT_SECRET:-enter_your_b24_app_secret}
BITRIX24_PHP_SDK_APPLICATION_SCOPE: ${SCOPE:-enter_your_b24_app_scope}
expose:
- "8000"
ports:
- "8000:8000"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./backends/php/:/var/www
- ./logs/php:/var/log/php
depends_on:
database-postgres:
condition: service_healthy
required: false
database-mysql:
condition: service_healthy
required: false
networks:
- internal-net
php-cli:
profiles: ["php", "php-cli"]
build:
context: ./backends/php
dockerfile: docker/php-cli/Dockerfile
container_name: php-cli
env_file: .env
environment:
DB_HOST: database
NODE_ENV: ${NODE_ENV:-development}
NUXT_PUBLIC_API_URL: ${VIRTUAL_HOST}
BITRIX24_PHP_SDK_APPLICATION_CLIENT_ID: ${CLIENT_ID:-enter_your_b24_app_client_id}
BITRIX24_PHP_SDK_APPLICATION_CLIENT_SECRET: ${CLIENT_SECRET:-enter_your_b24_app_secret}
BITRIX24_PHP_SDK_APPLICATION_SCOPE: ${SCOPE:-enter_your_b24_app_scope}
volumes:
- ./backends/php/:/var/www
- ./logs/php:/var/log/php
depends_on:
database-postgres:
condition: service_healthy
required: false
database-mysql:
condition: service_healthy
required: false
networks:
- internal-net
stdin_open: true
tty: true
api-python:
profiles: ["python"]
build:
context: ./backends/python
dockerfile: api/Dockerfile
target: ${BUILD_TARGET:-dev}
container_name: api
env_file: .env
environment:
DB_HOST: database
PORT: 8000
NUXT_PUBLIC_API_URL: ${VIRTUAL_HOST}
expose:
- "8000"
ports:
- "8000:8000"
volumes:
- ./backends/python/api:/var/www/api
- ./logs/python:/var/log/python
depends_on:
database-postgres:
condition: service_healthy
required: false
database-mysql:
condition: service_healthy
required: false
networks:
- internal-net
api-node:
profiles: ["node"]
container_name: api
build:
context: ./backends/node/api
dockerfile: Dockerfile
target: ${BUILD_TARGET:-dev}
env_file: .env
environment:
DB_HOST: database
NODE_ENV: ${NODE_ENV:-development}
NUXT_PUBLIC_API_URL: ${VIRTUAL_HOST}
PORT: 8000
expose:
- "8000"
ports:
- "8000:8000"
volumes:
- ./backends/node/api:/app
- ./logs/node:/var/log/node
depends_on:
database-postgres:
condition: service_healthy
required: false
database-mysql:
condition: service_healthy
required: false
networks:
- internal-net
networks:
internal-net:
driver: bridge
volumes:
postgres_data:
mysql_data:
cloudpub-config:
rabbitmq_data: