-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
140 lines (128 loc) · 3.11 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
version: "3.9"
x-common-environment-networks: &common-environment-networks
env_file: .env
networks:
- app-network
x-api-service-build: &api-service-build
build:
context: .
dockerfile: ./apps/api/Dockerfile
x-common-logging: &common-logging
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
services:
dashboard:
build:
context: .
dockerfile: ./apps/dashboard/Dockerfile
<<: *common-environment-networks
<<: *common-logging
restart: unless-stopped
depends_on:
- api
expose:
- 3000
healthcheck:
test: ["CMD-SHELL", "wget --spider -q http://dashboard:3000 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
api:
<<: [*api-service-build, *common-environment-networks, *common-logging]
restart: unless-stopped
expose:
- 8000
depends_on:
- db
- redis
- typesense
healthcheck:
test: ["CMD", "php", "artisan", "octane:status"]
interval: 30s
timeout: 10s
retries: 3
extra_hosts:
- "${API_DOMAIN:-api.test.local}:host-gateway"
horizon:
<<: [*api-service-build, *common-environment-networks, *common-logging]
restart: unless-stopped
environment:
CONTAINER_MODE: horizon
depends_on:
- api
healthcheck:
test: ["CMD", "php", "artisan", "horizon:status"]
interval: 30s
timeout: 10s
retries: 3
scheduler:
<<: [*api-service-build, *common-environment-networks, *common-logging]
restart: unless-stopped
environment:
CONTAINER_MODE: scheduler
depends_on:
- api
healthcheck:
test: ["CMD", "php", "artisan", "schedule:list"]
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:alpine
<<: *common-environment-networks
<<: *common-logging
restart: unless-stopped
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
command: redis-server --requirepass ${REDIS_PASSWORD}
expose:
- 6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
db:
image: mysql:8
<<: *common-environment-networks
<<: *common-logging
restart: unless-stopped
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
expose:
- 3306
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-uroot", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 30s
timeout: 10s
retries: 3
typesense:
image: typesense/typesense:26.0
<<: *common-environment-networks
<<: *common-logging
restart: unless-stopped
command: --data-dir /data --api-key=${TYPESENSE_API_KEY} --listen-port 8108 --enable-cors
volumes:
- typesense_data:/data
expose:
- 8108
healthcheck:
test: ["CMD-SHELL", "bash -c 'echo > /dev/tcp/localhost/8108'"]
interval: 30s
timeout: 10s
retries: 5
volumes:
mysql_data:
typesense_data:
tmpfiles:
driver: local
networks:
app-network:
driver: bridge