-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-prod.yml
179 lines (168 loc) · 3.95 KB
/
docker-compose-prod.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
version: "3.9"
services:
cron:
image: crazymax/swarm-cronjob:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
LOG_LEVEL: info
deploy:
placement:
constraints: [ node.role == manager ]
gateway:
image: ${REGISTRY}/lk-gateway:${IMAGE_TAG}
ports:
- target: 8080
published: 80
protocol: tcp
mode: host
- target: 8081
published: 8888
protocol: tcp
mode: host
deploy:
placement:
constraints: [ node.role == manager ]
networks:
- app_net
client:
image: ${REGISTRY}/lk-client:${IMAGE_TAG}
deploy:
mode: replicated
replicas: 2
update_config:
parallelism: 1
delay: 10s
networks:
- app_net
api:
image: ${REGISTRY}/lk-api:${IMAGE_TAG}
volumes:
- uploads:/app/storage/app/public
deploy:
mode: replicated
replicas: 2
update_config:
parallelism: 1
delay: 10s
networks:
- app_net
api-php-fpm:
image: ${REGISTRY}/lk-api-php-fpm:${IMAGE_TAG}
environment:
APP_NAME: Личный кабинет 120на80
APP_URL: http://192.168.2.19:8888
LOG_CHANNEL: stack
LOG_LEVEL: debug
DB_HOST: api-db
DB_DATABASE: app
DB_USERNAME: root
DB_PASSWORD: secret
FILESYSTEM_DISK: public
SANCTUM_STATEFUL_DOMAINS: 192.168.2.19:8888
# FILESYSTEM_DISK: sftp
# SFTP_URL: http://192.168.2.3/static/s
# SFTP_HOST: 192.168.2.3
# SFTP_USERNAME: Social
# SFTP_PASSWORD: 222326
BROADCAST_DRIVER: centrifugo
CENTRIFUGO_URL: http://centrifugo:8000
volumes:
- uploads:/app/storage/app/public
deploy:
mode: replicated
replicas: 2
update_config:
parallelism: 1
delay: 10s
networks:
- app_net
api-migration:
image: ${REGISTRY}/lk-api-php-cli:${IMAGE_TAG}
environment:
DB_HOST: api-db
DB_DATABASE: app
DB_USERNAME: root
DB_PASSWORD: secret
command: sh -c 'wait-for-it api-db:3306 -t 60 && php artisan migrate --force'
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 5
window: 120s
networks:
- app_net
api-db:
image: mariadb:10.8
environment:
MARIADB_ROOT_PASSWORD: secret
MARIADB_DATABASE: app
volumes:
- db-data:/var/lib/mysql
ports:
- target: 3306
published: 3306
protocol: tcp
mode: host
deploy:
placement:
constraints: [ node.role == manager ]
endpoint_mode: dnsrr
networks:
- app_net
scheduler:
image: ${REGISTRY}/lk-api-php-cli:${IMAGE_TAG}
environment:
APP_NAME: Личный кабинет 120на80
APP_URL: http://192.168.2.19:8888
LOG_CHANNEL: stack
LOG_LEVEL: debug
DB_HOST: api-db
DB_DATABASE: app
DB_USERNAME: root
DB_PASSWORD: secret
FILESYSTEM_DISK: public
# FILESYSTEM_DISK: sftp
# SFTP_URL: http://192.168.2.3/static/s
# SFTP_HOST: 192.168.2.3
# SFTP_USERNAME: Social
# SFTP_PASSWORD: 222326
volumes:
- uploads:/app/storage/app/public
command: sh -c 'php artisan schedule:run'
deploy:
labels:
- swarm.cronjob.enable=true
- swarm.cronjob.schedule=* * * * *
- swarm.cronjob.skip-running=true
replicas: 0
restart_policy:
condition: none
centrifugo:
image: ${REGISTRY}/lk-centrifugo:${IMAGE_TAG}
ulimits:
nofile:
soft: 65535
hard: 65535
ports:
- target: 8000
published: 8000
protocol: tcp
mode: host
deploy:
placement:
constraints: [ node.role == manager ]
endpoint_mode: dnsrr
networks:
- app_net
volumes:
db-data:
uploads:
networks:
app_net:
name: app_net
ipam:
driver: default
config:
- subnet: 192.168.199.0/24