-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
99 lines (86 loc) · 1.92 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
version: "3.7"
services:
nginx:
build:
context: .docker
dockerfile: nginx/Dockerfile
tty: true
restart: unless-stopped
networks:
- backend
- database
ports:
- "80:80"
- "443:443"
volumes:
- ./www:/var/www/html
- ./.docker/nginx/templates:/etc/nginx/templates
environment:
- NGINX_ROOT=/var/www/html/public
- NGINX_HOST=localhost
- NGINX_PORT=80
- PHP_HOST=php
- PHP_PORT=9000
- DB_HOST=database
- DB_PORT=3306
depends_on:
- database
command: bash -c 'wait4ports -q -t 60 -s 10 tcp://database:3306 tcp://php:9000; /docker-entrypoint.sh nginx -g "daemon off;"'
php:
build:
context: .docker
dockerfile: php-fpm/Dockerfile
args:
APP_ENVIROMENT: ${APP_ENVIROMENT}
tty: true
restart: always
networks:
- backend
- database
ports:
- 9000
volumes:
- "./www:/var/www/html"
environment:
- DB_HOST=database
- DB_PORT=3306
- APP_ENVIROMENT=${APP_ENVIROMENT}
- PROJECT_NAME=${COMPOSE_PROJECT_NAME}
- DB_USERNAME=docker
- DB_PASSWORD=123
- REDIS_HOST=''
- REDIS_PASSWORD=''
- REDIS_PORT=''
#redis:
# image: redis:6-alpine
# ports:
# - 6379
# networks:
# - backend
database:
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_DATABASE: ${COMPOSE_PROJECT_NAME}
MYSQL_ROOT_PASSWORD: 123
MYSQL_USER: docker
MYSQL_PASSWORD: 123
networks:
- database
ports:
- "3306:3306"
volumes:
- dbdata:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
networks:
backend:
driver: bridge
database:
driver: bridge
volumes:
dbdata:
driver: local
labels:
sh.project.name: ${COMPOSE_PROJECT_NAME}