forked from xiaoemoxiw/docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
executable file
·77 lines (75 loc) · 2.01 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
version: '3.5'
services:
nginx:
image: chenwl2016/nginx-stable:1.0.1
container_name: nginx
hostname: nginx
restart: always
ports:
- "8081:8081"
# - "8011:8011"
# - "8082:8082"
- "8443:8443"
volumes:
- ./www/source:/source
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d/:/etc/nginx/conf.d/:ro
# 需要开启SSL配置相关目录和文件
- ./nginx/ssl/:/etc/ssl/:ro
networks:
- admin
# php-fpm
fpm:
#image: registry.cn-shenzhen.aliyuncs.com/yxw-docker/php
image: chenwl2016/php-fpm-supervisor:1.0.12
container_name: php
hostname: php
restart: always
ports:
- "9000"
volumes:
- ./www/source:/source
- ./php-fpm/php.ini-production:/usr/local/etc/php/php.ini:ro
# 定时任务执行出问题,暂用supervisor 配置conf执行定期任务
#- ./php-fpm/cron/laravel:/var/spool/cron/crontabs/root
- ./php-fpm/supervisor/program.conf:/etc/supervisor/conf.d/program.conf
- ./php-fpm/supervisor/supervisord.conf:/etc/supervisord.conf
- ./php-fpm/supervisor/schedule.sh:/etc/supervisor/conf.d/schedule.sh
command: supervisord -c /etc/supervisor/supervisord.conf
networks:
- admin
# database
mysql:
image: mysql:5.7
container_name: mysql
hostname: mysql
restart: always
ports:
- "3306:3306"
volumes:
- ./mysql:/var/lib/mysql
- ./my.cnf:/etc/mysql/conf.d/my.cnf
environment:
- MYSQL_ROOT_PASSWORD=Mysqlpassword
networks:
- admin
redis:
image: redis:3
container_name: redis
hostname: 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"
networks:
- admin
networks:
admin:
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: 'false'
ipam:
driver: default
config:
- subnet: 172.19.19.0/24