-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
126 lines (121 loc) · 3.42 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
version: "3"
services:
nginx:
build:
context: ./services/nginx
args:
NGINX_VERSION: nginx:${NGINX_VERSION}
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
NGINX_INSTALL_APPS: ${NGINX_INSTALL_APPS}
container_name: nginx
ports:
- "${NGINX_HTTP_HOST_PORT}:80"
- "${NGINX_HTTPS_HOST_PORT}:443"
volumes:
- ${SOURCE_DIR}:/www/:rw
- ${NGINX_SSL_CERTIFICATE_DIR}:/ssl:rw
- ${NGINX_CONFD_DIR}:/etc/nginx/conf.d/:rw
- ${NGINX_CONF_FILE}:/etc/nginx/nginx.conf:ro
- ${NGINX_FASTCGI_PHP_CONF}:/etc/nginx/fastcgi-php.conf:ro
- ${NGINX_FASTCGI_PARAMS}:/etc/nginx/fastcgi_params:ro
- ${NGINX_LOG_DIR}:/var/log/nginx/:rw
environment:
TZ: "$TZ"
restart: always
networks:
- default
php:
build:
context: ./services/php
args:
PHP_VERSION: php:${PHP_VERSION}-fpm-alpine
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS: ${PHP_EXTENSIONS}
TZ: "$TZ"
container_name: php
expose:
- 9501
volumes:
- ${SOURCE_DIR}:/www/:rw
- ${PHP_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro
- ${PHP_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw
- ${PHP_LOG_DIR}:/var/log/php
- ${DATA_DIR}/composer:/tmp/composer
restart: always
cap_add:
- SYS_PTRACE
networks:
- default
supervisor:
build:
context: .
dockerfile: ./services/supervisor/Dockerfile
args:
PHP_VERSION: php:${SUPERVISOR_PHP_VERSION}-alpine
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
PHP_EXTENSIONS: ${SUPERVISOR_PHP_EXTENSIONS}
TZ: "$TZ"
container_name: supervisor
ports:
- "${SUPERVISOR_HOST_PORT_C}:9001"
extra_hosts:
- "www.site1.com:172.17.0.1"
volumes:
- ${SUPERVISOR_LOG}:/var/log/supervisor
- ${SUPERVISOR_CONFIG}:/etc/supervisor/conf.d
- ${SOURCE_DIR}:/www/:rw
- ${SUPERVISOR_PHP_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro
- ${SUPERVISOR_PHP_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw
- ${SUPERVISOR_PHP_LOG_DIR}:/var/log/phpsupervisor
- ${SUPERVISOR_CONF_FILE}:/etc/supervisor/supervisord.conf:ro
restart: always
cap_add:
- SYS_PTRACE
networks:
- default
mysql:
image: mysql:${MYSQL_VERSION}
container_name: mysql
ports:
- "${MYSQL_HOST_PORT}:3306"
volumes:
- ${MYSQL_CONF_FILE}:/etc/mysql/conf.d/mysql.cnf:ro
- ${DATA_DIR}/mysql:/var/lib/mysql/:rw
restart: always
networks:
- default
environment:
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
TZ: "$TZ"
redis:
image: redis:${REDIS_VERSION}
container_name: redis
ports:
- "${REDIS_HOST_PORT}:6379"
volumes:
- ${REDIS_CONF_FILE}:/etc/redis.conf:ro
- ${DATA_DIR}/redis:/data/:rw
restart: always
entrypoint: ["redis-server", "/etc/redis.conf"]
environment:
TZ: "$TZ"
networks:
- default
mongodb:
image: mongo:${MONGODB_VERSION}
container_name: mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: "${MONGODB_INITDB_ROOT_USERNAME}"
MONGO_INITDB_ROOT_PASSWORD: "${MONGODB_INITDB_ROOT_PASSWORD}"
TZ: "$TZ"
volumes:
- ${DATA_DIR}/mongo:/data/db:rw
- ${DATA_DIR}/mongo_key:/mongo:rw
ports:
- "${MONGODB_HOST_PORT}:27017"
networks:
- default
command:
--auth
networks:
default: