-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml.example
93 lines (82 loc) · 2.52 KB
/
docker-compose.yml.example
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
version: '3'
services:
### Nginx container #########################################
nginx:
image: nginx:alpine
ports:
- "${HTTP_PORT}:80"
- "${HTTPS_PORT}:443"
volumes:
- ${PROJECT_FOLDER}:/var/www/html:rw
- ./components/nginx/config/nginx.conf:/etc/nginx/nginx.conf:ro
- ./components/nginx/config/conf.d:/etc/nginx/conf.d:ro
- ./components/nginx/log:/var/log/nginx:rw
restart: always
privileged: true
networks:
- diy-network
### PHP container #########################################
php:
build:
context: ./build/php
args:
TIME_ZONE: ${GLOBAL_TIME_ZONE}
CHANGE_SOURCE: ${GLOBAL_CHANGE_SOURCE}
volumes:
- ${PROJECT_FOLDER}:/var/www/html:rw
- ./components/php/config/php.ini:/usr/local/etc/php/php.ini:ro
- ./components/php/config/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf:rw
- ./components/php/log:/var/log:rw
restart: always
privileged: true
networks:
- diy-network
### Mysql container #########################################
mysql:
image: mysql:5.7
ports:
- "${MYSQL_PORT}:3306"
volumes:
- ./components/mysql/data:/var/lib/mysql:rw
- ./components/mysql/config/mysql.cnf:/etc/mysql/conf.d/mysql.cnf:ro
- ./components/mysql/log:/var/log/mysql:rw
restart: always
privileged: true
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
networks:
diy-network:
ipv4_address: ${MYSQL_SERVICE_IP}
### Redis container #########################################
redis:
image: redis:latest
ports:
- "${REDIS_PORT}:6379"
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- ./components/redis/config/redis.conf:/usr/local/etc/redis/redis.conf:rw
- ./components/redis/log:/var/log/redis:rw
- ./components/redis/data:/data:rw
restart: always
privileged: true
networks:
diy-network:
ipv4_address: ${REDIS_SERVICE_IP}
### MongoDB container #########################################
mongodb:
image: mongo:latest
ports:
- "${MONGODB_PORT}:27017"
volumes:
- ./components/mongodb/data:/data/db
restart: always
privileged: true
networks:
diy-network:
ipv4_address: ${MONGODB_SERVICE_IP}
networks:
diy-network:
driver: bridge
ipam:
config:
- subnet: ${GLOBAL_NETWORK_SUBNET}