forked from rootrl/php-environment-with-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
58 lines (51 loc) · 1.02 KB
/
docker-compose.yaml
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: '2'
services:
nginx:
depends_on:
- "php"
image: "nginx"
volumes:
- "$PWD/conf/nginx/conf.d:/etc/nginx/conf.d"
- "$PWD/www:/usr/share/nginx/html"
ports:
- "8888:80"
networks:
- oa-network
container_name: "oa-nginx"
command: /bin/bash -c "mkdir -p /var/www && ln -s /usr/share/nginx/html /var/www && nginx -g 'daemon off;'"
php:
image: "oa-php-fpm"
build:
context: .
dockerfile: "Dockerfile.php"
networks:
- oa-network
container_name: "oa-php-fpm"
volumes:
- "$PWD/www:/var/www/html"
mysql:
image: mysql:5.7
volumes:
- "$PWD/db_data:/var/lib/mysql"
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: oa
MYSQL_USER: oa
MYSQL_PASSWORD: oa123
ports:
- "3306:3306"
networks:
- oa-network
container_name: "oa-mysql"
redis:
image: "redis"
ports:
- "6379:6379"
networks:
- oa-network
volumes:
- "$PWD/conf/redis/redis.conf:/usr/local/etc/redis/redis.conf"
container_name: "oa-redis"
networks:
oa-network:
driver: bridge