-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
67 lines (61 loc) · 1.6 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
version: '3.3'
services:
web:
build:
context: ./
dockerfile: ./docker/web/Dockerfile
command: /bin/sh -c "envsubst '$$WEB_HOST_NAME $$WEB_HOST_IP' < /etc/nginx/conf_app/default.conf > /etc/nginx/conf.d/default.conf && while ! nc -w 1 -z db 3306; do sleep 0.1; done; nginx -g 'daemon off;'"
volumes:
- ./docker/web/nginx.conf:/etc/nginx/conf_app/default.conf
- ./code/php:/var/www/code/php:ro
- ./log/web:/var/log/nginx
- ./static:/var/www/resource/static:ro
- ./upload:/var/www/resource/upload
- "sockets-volume-web-to-php:/sockets/web-to-php"
networks:
- backend-php-network
ports:
- "80:80"
- "443:443"
depends_on:
- db
- php
php:
build:
context: ./
dockerfile: ./docker/php/Dockerfile
environment:
- MYSQL_HOST
- MYSQL_SOCKET
- MYSQL_DATABASE
- MYSQL_USER
volumes:
- ./code/php:/var/www/code/php:ro
- ./upload:/var/www/resource/upload
- "sockets-volume-web-to-php:/sockets/web-to-php"
- "sockets-volume-php-to-db:/sockets/php-to-db"
networks:
- backend-php-network
depends_on:
- db
db:
build:
context: ./
dockerfile: ./docker/db/Dockerfile
environment:
- MYSQL_DATABASE
- MYSQL_USER
volumes:
- ./db:/var/lib/mysql
- ./log/db:/var/log/mysql
- "sockets-volume-php-to-db:/var/run/mysqld"
networks:
- backend-php-network
ports:
- "3306:3306"
networks:
backend-php-network:
driver: bridge
volumes:
sockets-volume-web-to-php:
sockets-volume-php-to-db: