-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
171 lines (157 loc) · 3.42 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# version: '3.8'
# services:
# nginx:
# build:
# context: ./docker/nginx
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./:/var/www
# - ./docker/nginx/nginx_log:/var/log/nginx
# - ./docker/php/php-fpm/php-fpm.log:/var/log/php-fpm.log
# - ./docker/nginx/nginx.conf:/etc/nginx/conf.d/nginx.conf
# depends_on:
# - php
# networks:
# - app-network
# php:
# build:
# context: ./docker/php
# ports:
# - "8001:80"
# environment:
# - DB_PORT=3306
# - DB_HOST=mysql
# # - DB_HOST=host.docker.internal
# volumes:
# - ./:/var/www/html
# depends_on:
# - mysql
# networks:
# - app-network
# mysql:
# build:
# context: ./docker/mysql
# ports:
# - "5554:3306"
# volumes:
# - db_data:/var/lib/mysql
# environment:
# - MYSQL_DATABASE=social_media
# - MYSQL_ROOT_PASSWORD=admin
# expose:
# - 3306
# networks:
# - app-network
# phpmyadmin:
# build:
# context: ./docker/phpmyadmin
# ports:
# - "8080:80"
# environment:
# PMA_HOST: mysql
# depends_on:
# - mysql
# networks:
# - app-network
# networks:
# app-network:
# driver: bridge
# volumes:
# db_data: {}
version: '3'
services:
#PHP Service
php:
build:
context: ./docker/php
container_name: php
restart: unless-stopped
tty: true
environment:
# - DB_PORT=3306
# - DB_HOST=mysql
SERVICE_NAME: php
SERVICE_TAGS: dev
working_dir: /var/www/html
volumes:
- .:/var/www/html
# - ./docker/php/php-fpm/php-fpm.log:/var/log/php-fpm.log
- ./docker/php/php.ini:/usr/local/etc/php/conf.d/php.ini
depends_on:
- mysql
networks:
- app-network
#Nginx Service
nginx:
build:
context: ./docker/nginx
container_name: nginx
restart: unless-stopped
tty: true
ports:
- "8080:80"
# - "443:443"
volumes:
- .:/var/www/html
- ./docker/nginx/conf.d:/etc/nginx/conf.d/
- ./docker/nginx/nginx_log:/var/log/nginx
# - ./docker/phpmyadmin/phpmyadmin.conf:/etc/nginx/conf.d/phpmyadmin.conf:ro
# - phpmyadmin_data:/var/www/html/:ro
depends_on:
- php
- mysql
networks:
- app-network
#MySQL Service
mysql:
build:
context: ./docker/mysql
container_name: mysql
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
# tty: true
ports:
- "3307:3306"
environment:
MYSQL_DATABASE: social_media
MYSQL_ROOT_PASSWORD: null
MYSQL_ALLOW_EMPTY_PASSWORD: "true" # Allow empty password
MYSQL_USER: admin
MYSQL_PASSWORD: admin
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- db_data:/var/lib/mysql
- ./docker/mysql/my.cnf:/etc/mysql/my.cnf
expose:
- 3306
networks:
- app-network
# phpmyadmin Service
phpmyadmin:
build:
context: ./docker/phpmyadmin
restart: unless-stopped
ports:
- "8081:80"
environment:
MYSQL_ROOT_PASSWORD: null
PMA_HOST: mysql
PMA_PORT: 3306
PMA_ARBITRARY: 1
# volumes:
# - phpmyadmin_data:/var/www/html/
depends_on:
- mysql
links:
- mysql
networks:
- app-network
#Docker Networks
networks:
app-network:
# driver: bridge
volumes:
db_data: {}