Skip to content

Commit 0dd3e69

Browse files
authored
Merge pull request #8 from mitakeck/fix_7
γƒγƒΌγƒγƒ£γƒ«γƒ›γ‚Ήγƒˆγ—γŸγ„ #7
2 parents 4fb3b76 + efb4ae6 commit 0dd3e69

File tree

5 files changed

+53
-6
lines changed

5 files changed

+53
-6
lines changed

β€ŽDockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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

β€ŽREADME.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,28 @@
1515

1616
## Setup
1717

18+
## build docker container
19+
1820
```
21+
$ docker-compose build
1922
$ docker-compose up -d
2023
```
2124

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)

β€Ždocker-compose.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
version: "2"
22
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
310
mysql:
411
container_name: "mysql"
512
build: ./docker/mysql/
@@ -10,13 +17,14 @@ services:
1017
- ./docker/mysql/volums:/var/lib/mysql
1118
- ./docker/mysql/log/:/var/log/mysql
1219
environment:
13-
MYSQL_ROOT_PASSWORD: "root"
20+
- MYSQL_ROOT_PASSWORD=root
21+
- VIRTUAL_HOST=mysql.dev
1422
php:
1523
build: ./docker/php7-imagick-httpd/
1624
tty: true
17-
ports:
18-
- "10080:80"
1925
volumes:
2026
- ./htdoc:/var/www/html
2127
links:
2228
- mysql
29+
environment:
30+
- VIRTUAL_HOST=web.local

β€Ždocker/mysql/conf.d/log.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ general_log_file=/var/log/mysql/query.log
55
slow_query_log=1
66
slow_query_log_file=/var/log/mysql/slow-query.log
77
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

β€Ždocker/nginx-proxy/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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+

0 commit comments

Comments
Β (0)