-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
60 lines (54 loc) · 1.77 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
version: '3'
services:
nginx_instance:
image: nginx
ports:
- "80:80"
volumes:
# not indispensable since it would be set by php-fpm instance before the startup of nginx instance
# - ./www:/usr/share/nginx/html
- ./nginx/default:/etc/nginx/conf.d/default.conf
- ./logs/nginx_access.log:/var/log/nginx/default_access.log
- ./logs/nginx_error.log:/var/log/nginx/default_error.log
restart: always
depends_on:
- fpm_instance
- wordpress_instance
fpm_instance:
#image: php:fpm
# build a fpm image with redis and mysqli extension
build: ./fpm/
expose:
- "9000"
volumes:
- ./www:/usr/share/nginx/html
depends_on:
- mysql_instance
- redis_instance
mysql_instance:
image: mysql:8.0
environment:
# set root password
MYSQL_ROOT_PASSWORD: "123456"
# create a database named "wordpress" and create a user along with its password
MYSQL_DATABASE: 'wordpress'
MYSQL_USER: 'wp'
MYSQL_PASSWORD: '123456'
restart: always
redis_instance:
image: redis
# start Redis instance with specified config file
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
restart: always
wordpress_instance:
depends_on:
- mysql_instance
- redis_instance
image: wordpress
restart: always
environment:
WORDPRESS_DB_HOST: mysql_instance:3306
WORDPRESS_DB_USER: 'wp'
WORDPRESS_DB_PASSWORD: '123456'