forked from thedrint/dockrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
124 lines (104 loc) · 2.84 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
version: '2'
### Network
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: $SUBNET
gateway: $GATEWAY
### Services
services:
### Nginx Server Container ##################################
nginx:
build:
context: $DOCKRIXDIR/nginx
dockerfile: nginx-$NGINX_VERSION.dock
volumes_from:
- source
- data
ports:
- "$NGINX_PORTS"
links:
- php-fpm
networks:
default:
ipv4_address: $NGINX_IP
aliases:
- $PROJECT_DOMAIN
### PHP-FPM Container #######################################
php-fpm:
build:
context: $DOCKRIXDIR/php-fpm
dockerfile: php-fpm-$PHP_VERSION.dock
volumes_from:
- source
expose:
- "9000"
# links:
# - workspace
environment:
MYSQL_DATABASE: $MYSQL_DATABASE
MYSQL_USER: $MYSQL_USER
MYSQL_PASSWORD: $MYSQL_PASSWORD
MYSQL_HOST: $MYSQL_IP
networks:
default:
ipv4_address: $PHP_IP
## MySQL Container
mysql:
build:
context: $DOCKRIXDIR/mysql
dockerfile: mysql-$PHP_VERSION.dock
volumes_from:
- data
ports:
- "$MYSQL_PORTS"
environment:
MYSQL_DATABASE: $MYSQL_DATABASE
MYSQL_USER: $MYSQL_USER
MYSQL_PASSWORD: $MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
networks:
default:
ipv4_address: $MYSQL_IP
### Memcached Container
memcached:
build:
context: $DOCKRIXDIR/memcached
dockerfile: memcached-$MEMCACHED_VERSION.dock
volumes_from:
- data
ports:
- "$MEMCACHED_PORTS"
links:
- php-fpm
networks:
default:
ipv4_address: $MEMCACHED_IP
### Workspace Utilities Container
# workspace:
# build:
# context: $DOCKRIXDIR/workspace
# ports:
# - "$WORKSPACE_PORTS"
# volumes_from:
# - source
# tty: true
# networks:
# default:
# ipv4_address: $WORKSPACE_IP
### Application Code Container
source:
build: $DOCKRIXDIR/volumes/source
volumes:
- $PROJECT_PATH:/var/www/site
### Databases Data Container
data:
build: $DOCKRIXDIR/volumes/data
volumes:
- $DOCKRIXDIR/var/lib/mysql:/var/lib/mysql
- $DOCKRIXDIR/var/lib/memcached:/var/lib/memcached
- $DOCKRIXDIR/var/log/nginx:/var/log/nginx
- $DOCKRIXDIR/var/log/php:/var/log/php