質問編集履歴

1

記述修正

2020/04/08 01:58

投稿

Casablanca_mtg
Casablanca_mtg

スコア209

test CHANGED
File without changes
test CHANGED
@@ -19,6 +19,88 @@
19
19
 
20
20
 
21
21
  この場合Portによる競合はエラーとして出ませんでしたがcontainerでの競合が出てしまいました。
22
+
23
+
24
+
25
+ ![イメージ説明](82b9fcee2c822c53da3aea5bc0dca224.png)
26
+
27
+
28
+
29
+ ```docker.compose.yml
30
+
31
+ version: '3'
32
+
33
+
34
+
35
+ services:
36
+
37
+ php:
38
+
39
+ container_name: php
40
+
41
+ build: ./docker/php
42
+
43
+ volumes:
44
+
45
+ - ./server:/var/www
46
+
47
+
48
+
49
+ nginx:
50
+
51
+ image: nginx
52
+
53
+ container_name: nginx
54
+
55
+ ports:
56
+
57
+ - 80:80
58
+
59
+ volumes:
60
+
61
+ - ./server:/var/www
62
+
63
+ - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
64
+
65
+ depends_on:
66
+
67
+ - php
68
+
69
+
70
+
71
+ db:
72
+
73
+ image: mysql:5.7
74
+
75
+ container_name: db-host
76
+
77
+ environment:
78
+
79
+ MYSQL_ROOT_PASSWORD: root
80
+
81
+ MYSQL_DATABASE: database
82
+
83
+ MYSQL_USER: docker
84
+
85
+ MYSQL_PASSWORD: docker
86
+
87
+ TZ: 'Asia/Tokyo'
88
+
89
+ command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
90
+
91
+ volumes:
92
+
93
+ - ./docker/db/data:/var/lib/mysql
94
+
95
+ - ./docker/db/my.cnf:/etc/mysql/conf.d/my.cnf
96
+
97
+ - ./docker/db/sql:/docker-entrypoint-initdb.d
98
+
99
+ ports:
100
+
101
+ - 3306:3306
102
+
103
+ ```
22
104
 
23
105
  ```
24
106