-
Notifications
You must be signed in to change notification settings - Fork 59
/
docker-compose.yml
141 lines (133 loc) · 3.79 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
version: '2.1'
services:
### Nginx Web Container #######################################
nginx:
build: ./nginx
container_name: lnmp-nginx
ports:
- "80:80"
- "443:443"
#source code container
volumes_from:
- www
volumes:
- "./nginx/logs:/var/log/nginx"
- "./nginx/socket:/var/run"
links:
- php-fpm:php-fpm
networks:
web_server_network:
ipv4_address: ${NGINX_WEB_SERVER_IP}
### PHP-FPM Container #######################################
php-fpm:
image: bravist/php-fpm-alpine-aliyun-app:1.17
container_name: lnmp-php-fpm
#source code container
volumes_from:
- www
volumes:
- "./nginx/logs/php-fpm:/usr/local/var/log/php7"
- "./nginx/socket:/var/run"
links:
- mariadb
- redis
#https://github.com/laradock/laradock/issues/435
extra_hosts:
- "${PHP_FPM_DOMAIN}:${NGINX_WEB_SERVER_IP}"
- "${PHP_FPM_DOMAIN2}:${NGINX_WEB_SERVER_IP}"
- "${PHP_FPM_DOMAIN3}:${NGINX_WEB_SERVER_IP}"
- "${PHP_FPM_DOMAIN4}:${NGINX_WEB_SERVER_IP}"
- "${PHP_FPM_DOMAIN5}:${NGINX_WEB_SERVER_IP}"
- "${PHP_FPM_DOMAIN6}:${NGINX_WEB_SERVER_IP}"
env_file:
- .env
networks:
- web_server_network
### PHP-SUPERVISOR Container #######################################
php-supervisor:
build: ./php-supervisor
container_name: lnmp-php-supervisor
volumes:
- ./php-supervisor/supervisor/log:/var/log/supervisor
- ./php-supervisor/supervisor:/etc/supervisor/conf.d
volumes_from:
- www
links:
- mariadb
- redis
extra_hosts:
- "${SUPERVISOR_DOMAIN}:${NGINX_WEB_SERVER_IP}"
- "${SUPERVISOR_DOMAIN2}:${NGINX_WEB_SERVER_IP}"
- "${SUPERVISOR_DOMAIN3}:${NGINX_WEB_SERVER_IP}"
- "${SUPERVISOR_DOMAIN4}:${NGINX_WEB_SERVER_IP}"
- "${SUPERVISOR_DOMAIN5}:${NGINX_WEB_SERVER_IP}"
- "${SUPERVISOR_DOMAIN6}:${NGINX_WEB_SERVER_IP}"
env_file:
- .env
networks:
- web_server_network
### CALL-WEBSOCKET Container #######################################
call-websocket:
build: ./call-websocket
container_name: lnmp-call-websocket
volumes_from:
- www
ports:
- "8190:8190"
- "8191:8191"
networks:
- web_server_network
### PHP-CROND Container #######################################
php-crond:
build: ./php-crond
container_name: lnmp-php-crond
volumes_from:
- "www"
volumes:
- "./php-crond/crontabs:/var/log/cron"
networks:
- web_server_network
### MariaDB Container #######################################
# MariaDB - One of the most popular database servers. Made by the original developers of MySQL. Guaranteed to stay open source.
mariadb:
image: mariadb:10.2
container_name: lnmp-mariadb
ports:
- "3306:3306"
volumes:
# NOTE: your data will be stored in ./mysql
- ./mariadb/data/mysql:/var/lib/mysql
environment:
- MYSQL_DATABASE=mysql
- MYSQL_USER=developer
- MYSQL_PASSWORD=developer
- MYSQL_ROOT_PASSWORD=developer
networks:
- web_server_network
### REDIS Container #######################################
redis:
build: ./redis
container_name: lnmp-redis
ports:
- "6379:6379"
volumes:
- "./redis/data:/data"
environment:
- REDIS_PASSWORD=developer
networks:
- web_server_network
### Web-Root Container #######################################
www:
image: tianon/true
container_name: lnmp-www
volumes:
- ./www:/usr/share/nginx/html
### Networks Setup ############################################
networks:
web_server_network:
driver: bridge
ipam:
driver: default
config:
- subnet: "${WEB_SERVER_SUBNET}"
gateway: "${WEB_SERVER_GATEWAY}"