forked from xiaoemoxiw/docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-nginx-php-redis-npm.yml
executable file
·71 lines (66 loc) · 1.79 KB
/
docker-compose-nginx-php-redis-npm.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
version: '3'
services:
nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
volumes:
- /Volumes/data/source:/source
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d/:/etc/nginx/conf.d/:ro
links:
- fpm:fpm
# php-fpm
fpm:
image: registry.cn-shenzhen.aliyuncs.com/yxw-docker/php
container_name: php
ports:
- "9000"
links:
- mysql:mysql
- redis:redis
volumes:
- /Volumes/data/source:/source
- ./php-fpm/php.ini-production:/usr/local/etc/php/php.ini:ro
- ./php-fpm/cron/laravel:/var/spool/cron/crontabs/laravel
- ./php-fpm/supervisor/program.conf:/etc/supervisor/conf.d/program.conf
command: supervisord -c /etc/supervisor/supervisord.conf
# database
mysql:
image: mysql:5.7
container_name: mysql
ports:
- "3306:3306"
volumes:
- ./mysql:/var/lib/mysql
- ./my.cnf:/etc/mysql/conf.d/my.cnf
environment:
- MYSQL_ROOT_PASSWORD=mypassword
redis:
image: redis:3
container_name: redis
command: redis-server /usr/local/etc/redis/redis.conf --requirepass mypassword
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
ports:
- "6379:6379"
node:
image: registry.cn-shenzhen.aliyuncs.com/yxw-docker/node8.9.3:latest
container_name: node
hostname: node
ports:
- "7001:7001"
working_dir: /source/lx-egg
links:
- redis:redis
volumes:
- /source:/source
# >在字符串中折叠换行,| 保留换行符,这两个符号是YAML中字符串经常使用的符号
# command:
# - /bin/sh
# - -c
# - |
# yarn install
# pm2-runtime start ecosystem.config.js
command: ["/bin/sh", "-c", "yarn install && yarn dev"]