forked from fjqtp/rating
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
77 lines (71 loc) · 1.72 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
version: "3"
networks:
database:
server:
volumes:
mysql-data:
services:
php:
build:
context: .
dockerfile: ./Dockerfile
container_name: php
volumes:
- ./site:/site:cached
restart: always
networks:
- database
- server
depends_on:
- mysql
working_dir: /site
command: /bin/bash -c "npm install && ./node_modules/bower/bin/bower install --allow-root && ./node_modules/gulp-cli/bin/gulp.js && composer install && php-fpm"
php-api:
build:
context: .
dockerfile: ./Dockerfile_api
container_name: php-api
volumes:
- ./api:/api:cached
restart: always
networks:
- database
- server
working_dir: /api
depends_on:
- mysql
command: /bin/bash -c "composer install && php-fpm"
mysql:
image: mysql:8.0.18
volumes:
- mysql-data:/var/lib/mysql
restart: always
ports:
- "3306:3306"
networks:
- database
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_DATABASE: test
command: mysqld --sql_mode="" --default-authentication-plugin=mysql_native_password
#--default-authentication-plugin=mysql_native_password
nginx:
image: nginx
container_name: nginx
volumes:
- ./site:/site:ro
- ./api:/api:ro
- ./default.template.conf:/etc/nginx/conf.d/mysite.template
restart: always
ports:
- "80:80"
environment:
- NGINX_HOST=rating
command: /bin/bash -c "envsubst '${NGINX_HOST}' < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
networks:
- server
depends_on:
- php