File tree Expand file tree Collapse file tree 5 files changed +53
-6
lines changed Expand file tree Collapse file tree 5 files changed +53
-6
lines changed Original file line number Diff line number Diff line change
1
+ " Press ? for help
2
+
3
+ .. (up a dir)
4
+ </mitake/Desktop/docker-study/
5
+ βΎ docker/
6
+ βΈ mysql/
7
+ βΎ nginx-proxy/
8
+ Dockerfile
9
+ βΈ php7-imagick-httpd/
10
+ βΈ htdoc/
11
+ docker-compose.yml
12
+ LICENSE
13
+ README.md
Original file line number Diff line number Diff line change 15
15
16
16
## Setup
17
17
18
+ ## build docker container
19
+
18
20
```
21
+ $ docker-compose build
19
22
$ docker-compose up -d
20
23
```
21
24
22
- open ` http://localhost:10080 `
25
+ ### network configure
26
+
27
+ ```
28
+ $ vim /etc/hosts
29
+ 127.0.0.1 web.local
30
+ 127.0.0.1 mysql.local
31
+ ```
32
+
33
+ open ` http://web.local `
34
+
35
+
36
+ ## Memo
37
+
38
+ ### CONNECT FROM A CONTAINER TO A SERVICE ON THE HOST
39
+
40
+ ` docker.for.mac.localhost `
41
+
42
+ [ https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host ] ( https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host )
Original file line number Diff line number Diff line change 1
1
version : " 2"
2
2
services :
3
+ proxy :
4
+ container_name : " nginx-proxy"
5
+ build : ./docker/nginx-proxy/
6
+ ports :
7
+ - " 80:80"
8
+ volumes :
9
+ - /var/run/docker.sock:/tmp/docker.sock:ro
3
10
mysql :
4
11
container_name : " mysql"
5
12
build : ./docker/mysql/
@@ -10,13 +17,14 @@ services:
10
17
- ./docker/mysql/volums:/var/lib/mysql
11
18
- ./docker/mysql/log/:/var/log/mysql
12
19
environment :
13
- MYSQL_ROOT_PASSWORD : " root"
20
+ - MYSQL_ROOT_PASSWORD=root
21
+ - VIRTUAL_HOST=mysql.dev
14
22
php :
15
23
build : ./docker/php7-imagick-httpd/
16
24
tty : true
17
- ports :
18
- - " 10080:80"
19
25
volumes :
20
26
- ./htdoc:/var/www/html
21
27
links :
22
28
- mysql
29
+ environment :
30
+ - VIRTUAL_HOST=web.local
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ general_log_file=/var/log/mysql/query.log
5
5
slow_query_log =1
6
6
slow_query_log_file =/var/log/mysql/slow-query.log
7
7
long_query_time =1
8
- # log-queries-not-using-indexes
9
- # log-error=/var/log/mysql/error.log
8
+ log-queries-not-using-indexes
9
+ log-error =/var/log/mysql/error.log
Original file line number Diff line number Diff line change
1
+ FROM jwilder/nginx-proxy
2
+ RUN { \
3
+ echo 'server_tokens off;' ; \
4
+ echo 'client_max_body_size 100g;' ; \
5
+ } > /etc/nginx/conf.d/my_proxy.conf
6
+
You canβt perform that action at this time.
0 commit comments