-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (103 loc) · 2.65 KB
/
docker-compose.yml
File metadata and controls
110 lines (103 loc) · 2.65 KB
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
100
101
102
103
104
105
106
107
108
109
110
version: '3.8'
# Services
services:
# NGINX Service
nginx-web-chat:
image: nginx:latest
container_name: nginx-web-chat
restart: always
ports:
- "80:80"
- "8000:80"
- "443:443"
volumes:
- ./:/var/www/web-chat.loc
- ./.docker/nginx/conf.d:/etc/nginx/conf.d
- ./.docker/nginx/logs:/var/log/nginx
- ./.docker/nginx/certs:/etc/nginx/certs
depends_on:
- php-web-chat
networks:
- network-web-chat
# PHP Service
php-web-chat:
image: php-web-chat
build:
context: ./
dockerfile: .docker/php/Dockerfile
working_dir: /var/www/web-chat.loc
container_name: php-web-chat
volumes:
- ./:/var/www/web-chat.loc
- /var/www/web-chat.loc/vendor
- ./.docker/php/php.ini:/usr/local/etc/php/php.ini
depends_on:
mysql-web-chat:
condition: service_healthy
networks:
- network-web-chat
# WebSocket service
ws-web-chat:
image: ws-web-chat
build:
context: ./
dockerfile: .docker/php/Dockerfile
container_name: ws-web-chat
restart: always
volumes:
- ./:/var/www/web-chat.loc
- /var/www/web-chat.loc/vendor
depends_on:
mysql-web-chat:
condition: service_healthy
entrypoint: ["php", "/var/www/web-chat.loc/websocket.php", "start"]
expose:
- 8282
networks:
- network-web-chat
# MySQL Service
mysql-web-chat:
image: mysql:latest
restart: always
ports:
- '3306:3306'
container_name: mysql-web-chat
environment:
MYSQL_USER: ${MYSQL_USER}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci','--default-time-zone=+03:00']
volumes:
- ./.docker/mysql/my.cnf:/etc/mysql/my.cnf
- mysqldata:/var/lib/mysql
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD
interval: 5s
retries: 10
networks:
network-web-chat:
aliases:
- ${MYSQL_HOST_ALIAS}
# PhpMyAdmin Service
phpmyadmin-web-chat:
image: phpmyadmin
container_name: pma-web-chat
ports:
- "8080:80"
environment:
- PMA_ARBITRARY=1
- PMA_HOST=mysql
depends_on:
mysql-web-chat:
condition: service_healthy
networks:
- network-web-chat
# Volumes
volumes:
mysqldata:
# Networks
networks:
network-web-chat:
name: network-web-chat
driver: bridge