-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
162 lines (153 loc) · 3.54 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: '3'
networks:
frontend:
driver: ${NETWORKS_DRIVER}
backend:
driver: ${NETWORKS_DRIVER}
services:
### WORKSPACE ###
workspace:
hostname: workspace
build:
context: ./workspace
args:
- TZ=${TZ}
- PHP_VERSION=${PHP_VERSION}
- NODE_VERSION=${NODE_VERSION}
volumes:
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}"
tty: true
networks:
- frontend
- backend
dns:
- 1.1.1.1
- 8.8.8.8
- 9.9.9.9
ports:
- 8089:8089
- 8090:8090
### PHP-FPM ###
php-fpm:
hostname: php-fpm
build:
context: ./php-fpm
args:
- TZ=${TZ}
- PHP_VERSION=${PHP_VERSION}
volumes:
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
expose:
- 9000
extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}"
networks:
- backend
dns:
- 1.1.1.1
- 8.8.8.8
- 9.9.9.9
### NGINX ###
nginx:
hostname: nginx
build:
context: ./nginx
args:
- NGINX_VERSION=${NGINX_VERSION}
- PHP_UPSTREAM_PORT=${PHP_UPSTREAM_PORT}
- PHP_UPSTREAM_CONTAINER=${PHP_UPSTREAM_CONTAINER}
volumes:
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
- ${NGINX_SITES_PATH}:/etc/nginx/sites-available
- ${NGINX_HOST_LOG_PATH}:/var/log/nginx
ports:
- ${NGINX_HOST_HTTP_PORT}:80
- ${NGINX_HOST_HTTPS_PORT}:443
depends_on:
- php-fpm
networks:
- frontend
- backend
dns:
- 1.1.1.1
- 8.8.8.8
- 9.9.9.9
### MYSQL ###
mysql:
hostname: mysql
build:
context: ./mysql
args:
- TZ=${TZ}
- MYSQL_VERSION=${MYSQL_VERSION}
environment:
- MYSQL_ROOT_HOST='%'
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- ${DATA_PATH_HOST}/mysql:/var/lib/mysql
- ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
ports:
- ${MYSQL_PORT}:3306
networks:
- backend
dns:
- 1.1.1.1
- 8.8.8.8
- 9.9.9.9
# ### MARIADB ###
# mariadb:
# hostname: mariadb
# build:
# context: ./mariadb
# args:
# - TZ=${TZ}
# - MARIADB_VERSION=${MARIADB_VERSION}
# environment:
# - MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
# volumes:
# - ${DATA_PATH_HOST}/mysql:/var/lib/mysql
# - ${MARIADB_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
# ports:
# - ${MARIADB_PORT}:3306
# networks:
# - backend
# dns:
# - 1.1.1.1
# - 8.8.8.8
# - 9.9.9.9
### REDIS ###
redis:
hostname: redis
build:
context: ./redis
args:
- REDIS_VERSION=${REDIS_VERSION}
volumes:
- ${DATA_PATH_HOST}/redis:/data
ports:
- ${REDIS_PORT}:6379
networks:
- backend
dns:
- 1.1.1.1
- 8.8.8.8
- 9.9.9.9
# ### PORTAINER ###
# portainer:
# hostname: portainer
# build:
# context: ./portainer
# volumes:
# - ${DATA_PATH_HOST}/portainer_data:/data
# - /var/run/docker.sock:/var/run/docker.sock
# ports:
# - ${PORTAINER_PORT}:9000
# networks:
# - frontend
# - backend
# dns:
# - 1.1.1.1
# - 8.8.8.8
# - 9.9.9.9