-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
264 lines (251 loc) · 8.57 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
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
version: '3.7'
services:
# REQUESTS PROXY
proxy:
container_name: miniserver-dev-nginx
build:
context: .
dockerfile: .docker/dev/Dockerfile
args:
BACKEND_PREFIX: ${API_PREFIX:-/api}
target: fastybird_nginx
depends_on:
- backend
- frontend
environment:
# Container specific environment variables
TZ: ${APP_TZ:-UTC}
volumes:
- ./public:/srv/fastybird/public:ro
ports:
- "${HTTP_PORT:-80}:80"
networks:
- fastybird
# APPLICATION BACKEND
backend:
container_name: miniserver-dev-backend
build:
context: .
dockerfile: .docker/dev/Dockerfile
target: fastybird_php
depends_on:
- migrations
environment:
# Container specific environment variables
TZ: ${APP_TZ:-UTC}
PHP_DATE_TIMEZONE: ${APP_TZ:-UTC}
# Application specific environment variables
FB_APP_PARAMETER__DATABASE_HOST: database
FB_APP_PARAMETER__DATABASE_PORT: 3306
FB_APP_PARAMETER__DATABASE_USERNAME: ${DATABASE_USERNAME:-miniserver}
FB_APP_PARAMETER__DATABASE_PASSWORD: ${DATABASE_PASSWORD:-miniserver}
FB_APP_PARAMETER__DATABASE_DBNAME: ${DATABASE_DBNAME:-fb_miniserver}
FB_APP_PARAMETER__REDIS_HOST: redis
FB_APP_PARAMETER__REDIS_PORT: 6379
FB_APP_PARAMETER__SECURITY_SIGNATURE: ${SECURITY_SIGNATURE}
FB_APP_PARAMETER__API_PREFIX: ${API_PREFIX:-/api}
FB_APP_PARAMETER__API_PREFIXED_MODULES: ${API_PREFIXED_MODULES:-true}
FB_APP_PARAMETER__API_KEY: ${API_KEY:-}
FB_APP_PARAMETER__SOCKETS_PORT: 8080
FB_TEMP_DIR: /srv/fastybird/var/temp/backend
volumes:
- .:/srv/fastybird:rw,cached
- ./config:/srv/fastybird/config:rw
- ./var:/srv/fastybird/var:rw
- ./public:/srv/fastybird/public:rw,delegated
networks:
fastybird:
local_network:
ipv4_address: ${LOCAL_NETWORK_BACKEND_IP_ADDRESS:-192.168.0.10}
# APPLICATION BACKEND DATABASE MIGRATIONS
migrations:
container_name: miniserver-dev-migrations
build:
context: .
dockerfile: .docker/dev/Dockerfile
target: fastybird_migrations
depends_on:
- database
environment:
# Container specific environment variables
TZ: ${APP_TZ:-UTC}
PHP_DATE_TIMEZONE: ${APP_TZ:-UTC}
LOAD_FIXTURES: 1
# Application specific environment variables
FB_APP_PARAMETER__DATABASE_HOST: database
FB_APP_PARAMETER__DATABASE_PORT: 3306
FB_APP_PARAMETER__DATABASE_USERNAME: ${DATABASE_USERNAME:-miniserver}
FB_APP_PARAMETER__DATABASE_PASSWORD: ${DATABASE_PASSWORD:-miniserver}
FB_APP_PARAMETER__DATABASE_DBNAME: ${DATABASE_DBNAME:-fb_miniserver}
FB_APP_PARAMETER__REDIS_HOST: redis
FB_APP_PARAMETER__REDIS_PORT: 6379
FB_APP_PARAMETER__SECURITY_SIGNATURE: ${SECURITY_SIGNATURE}
FB_APP_PARAMETER__API_PREFIX: ${API_PREFIX:-/api}
FB_APP_PARAMETER__API_PREFIXED_MODULES: ${API_PREFIXED_MODULES:-true}
FB_APP_PARAMETER__API_KEY: ${API_KEY:-}
FB_APP_PARAMETER__SOCKETS_PORT: 8080
FB_TEMP_DIR: /srv/fastybird/var/temp/migrations
volumes:
- .:/srv/fastybird:rw,cached
- ./config:/srv/fastybird/config:rw
- ./var:/srv/fastybird/var:rw
networks:
- fastybird
# APPLICATION WORKER
worker:
container_name: miniserver-dev-worker
build:
context: .
dockerfile: .docker/dev/Dockerfile
target: fastybird_worker
depends_on:
- database
environment:
# Container specific environment variables
TZ: ${APP_TZ:-UTC}
PHP_DATE_TIMEZONE: ${APP_TZ:-UTC}
# Application specific environment variables
FB_APP_PARAMETER__DATABASE_HOST: database
FB_APP_PARAMETER__DATABASE_PORT: 3306
FB_APP_PARAMETER__DATABASE_USERNAME: ${DATABASE_USERNAME:-miniserver}
FB_APP_PARAMETER__DATABASE_PASSWORD: ${DATABASE_PASSWORD:-miniserver}
FB_APP_PARAMETER__DATABASE_DBNAME: ${DATABASE_DBNAME:-fb_miniserver}
FB_APP_PARAMETER__REDIS_HOST: redis
FB_APP_PARAMETER__REDIS_PORT: 6379
FB_APP_PARAMETER__SOCKETS_PORT: 8080
FB_TEMP_DIR: /srv/fastybird/var/temp/worker
volumes:
- .:/srv/fastybird:rw,cached
- ./config:/srv/fastybird/config:rw
- ./var:/srv/fastybird/var:rw
ports:
- "${WS_EXCHANGE_PORT:-8080}:8080"
- "${WORKER_STATUS_PORT:-9001}:9001"
networks:
fastybird:
local_network:
ipv4_address: ${LOCAL_NETWORK_WORKER_IP_ADDRESS:-192.168.0.20}
# APPLICATION FRONTEND
frontend:
container_name: miniserver-dev-frontend
build:
context: .
dockerfile: .docker/dev/Dockerfile
target: fastybird_node
command: ["yarn", "build:dev"]
depends_on:
- backend
environment:
# Container specific environment variables
TZ: ${APP_TZ:-UTC}
BACKEND_HOST: backend
BACKEND_PORT: 9000
# Application specific environment variables
FB_APP_PARAMETER__API_PREFIX: ${API_PREFIX:-/api}
FB_APP_PARAMETER__API_PREFIXED_MODULES: ${API_PREFIXED_MODULES:-true}
FB_APP_PARAMETER__API_KEY: ${API_KEY:-}
volumes:
- ./assets:/srv/fastybird/assets:rw,cached
- ./public:/srv/fastybird/public:rw,delegated
networks:
- fastybird
# MYSQL DATABASE STORAGE
database:
container_name: miniserver-dev-database
image: mariadb
environment:
# Container specific environment variables
TZ: ${APP_TZ:-UTC}
MYSQL_ROOT_PASSWORD: ${ROOT_PASSWORD:-root}
MYSQL_USER: ${DATABASE_USERNAME:-miniserver}
MYSQL_PASSWORD: ${DATABASE_PASSWORD:-miniserver}
MYSQL_DATABASE: ${DATABASE_DBNAME:-fb_miniserver}
volumes:
- mysql-dev-data:/var/lib/mysql:rw
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/mysql/data:/var/lib/mysql:rw,delegated
ports:
- "${MYSQL_PORT:-3306}:3306"
networks:
- fastybird
# REDIS STORAGE
redis:
container_name: miniserver-dev-redis
image: redis
volumes:
- redis-dev-other:/var/lib/redis:rw
- redis-dev-data:/data:rw
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/redis/other:/var/lib/redis:rw,delegated
# - ./docker/redis/data:/data:rw,delegated
ports:
- "${REDIS_PORT:-6379}:6379"
networks:
- fastybird
# COUCH DB STORAGE
couchdb:
container_name: miniserver-dev-couchdb
image: couchdb
environment:
# Container specific environment variables
COUCHDB_USER: ${COUCHDB_USERNAME:-admin}
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD:-admin}
volumes:
- couchdb-dev-data:/opt/couchdb/data:rw
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/couchdb/data:/opt/couchdb/data:rw,delegated
ports:
- "${COUCHDB_PORT:-5984}:5984"
networks:
- fastybird
# RABBIT MQ EXCHANGE
rabbitmq:
container_name: miniserver-dev-rabbitmq
image: rabbitmq:management
environment:
# Container specific environment variables
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME:-admin}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-admin}
volumes:
- rabbitmq-dev-data:/var/lib/rabbitmq:rw
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/rabbitmq/data:/var/lib/rabbitmq:rw,delegated
ports:
- "${RABBITMQ_PORT:-5672}:5672"
- "${RABBITMQ_MANAGEMENT_PORT:-15672}:15672"
networks:
- fastybird
# MQTT
mqtt:
container_name: miniserver-dev-mqtt
image: eclipse-mosquitto
volumes:
- mqtt-dev-data:/mosquitto/data:rw
- mqtt-dev-log:/mosquitto/log:rw
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/mqtt/data:/mosquitto/data:rw,delegated
ports:
- "${MQTT_PORT:-1883}:1883"
networks:
- fastybird
networks:
fastybird:
driver: bridge
local_network:
name: local_network
driver: macvlan
driver_opts:
parent: ${LOCAL_NETWORK_DRIVER:-eth0}
ipam:
config:
- subnet: ${LOCAL_NETWORK_SUBNET:-192.168.0.0/24}
gateway: ${LOCAL_NETWORK_GATEWAY:-192.168.0.1}
ip_range: ${LOCAL_NETWORK_IP_RANGE:-192.168.0.6/24}
volumes:
mysql-dev-data:
redis-dev-other:
redis-dev-data:
couchdb-dev-data:
mqtt-dev-data:
mqtt-dev-log:
rabbitmq-dev-data: