è¿½è¨ (2018.12.30)
PHP5.6, PHP7.1 ã«å ãã¦ãPHP7.2, PHP7.3 ã«ã対å¿ãã¾ããï¼ ã¾ããPHP ãã memcached ã«ã¤ãªããµã³ãã«ã追å ãã¾ããã
ã¯ããã«
ããã«ã¡ã¯ãå°è¥¿ã§ããéçºç°å¢ã®æ§ç¯ã£ã¦é¢åã§ãããã¼ã
ä»åãPHP, MySQL, PHP-FPM, nginx, memcached ã®ãã¼ã«ã«éçºç°å¢ããDocker ã使ã£ã¦ã³ãã³ãä¸çºã§ä½ãããããã«ããã¨ããããã¾ãã«ç°¡åã§é©ããã®ã§ããã®æ¹æ³ããç´¹ä»ãã¾ãã
ã½ã¼ã¹ã³ã¼ããgithubã«ããã¦ããã¾ã ã®ã§ãããã«èµ·åã§ãã¾ãï¼
éçºç°å¢æ§ç¯ã®ããã©ããã
åã¯PHP+MySQL+nginx+PHP-FPMã®ç°å¢ããã使ãã®ã§ããããããã£ãæ§æãããããã®ãã·ã³ã§åç¾ããã®ã£ã¦çµæ§é¢åãªãã§ãããã1ããã¸ã§ã¯ããªãã¾ã ããã§ããã大ä½ããã¸ã§ã¯ãã«ãã£ã¦ããããã®ãã¼ã¸ã§ã³ãè¨å®ãã¡ã¤ã«ã®ãã©ã¡ã¼ã¿ãªã©ãå¾®å¦ã«éãã®ã§ãphpenvã§ã®åãæ¿ããªããã»ã»ã»ãªãã¦è©±ã«ãªã£ã¦ãã¦ããªããªãé¢åã§ãã
ãã¯ãããã¸ã§ã¯ããã¨ã«ç°å¢ä½ææé ãå ±æããã»ããå¹çãããããã§ãã
ãªã Docker ?
Docker ã使ãã¨ã
- ããã¸ã§ã¯ããã¨ã«éçºç°å¢ãä½ããã¨ãã§ãã
- ã¤ã¡ã¼ã¸ãå ±æããããã§ã¯ãªããè¨è¨å³ã ãã®å ±æãªã®ã§ãªãã¸ããªãéããªããªã
- Vagrant ãªã©ã¨éãããã«ãã®ãã³ã« VM ãèµ·åãããããªãã®ã§è»½ã
Docker Toolbox ã§ã¯ãªã Docker for Mac (Docker for Windows)ã使ãçç±ã¯ã
- GUI ã§ã¤ã³ã¹ãã¼ã«ãå®çµããã®ã§ãå°å ¥ãç°¡å
- Docker 社ãä»å¾ã¯ãã¡ããé²ãã¦ããæ¹éã£ã½ã
2ã¤ã®éãã¯ä»¥åãã¡ãã«æ¸ãã¾ããï¼これからは Docker Toolbox よりも Docker for Mac を使おう - koni blog
DockerãDocker Compose ã¨ã¯
ä»åä½ããã®ã®æ¦å¿µãããããã£ãã説æããã¨ã
- åããããããã»ã¹ãã¨ã«
Docker ã¤ã¡ã¼ã¸
ãä½ãã¾ãDocker ã¤ã¡ã¼ã¸
ã¯ãDockerfile
ã¨ãããã¡ã¤ã«ããã¨ã«ãã«ããã¾ã- ããã¸ã§ã¯ãã¡ã³ãã¼ã«ã¯ã
ã¤ã¡ã¼ã¸
ã§ã¯ãªããDockerfile
ãå ±æãã¾ãï¼Dockerfile
ã¯ããã¹ããã¡ã¤ã«ãªã®ã§è»½ãï¼ - åºæ¬çã«ã¯ã1ã¤ã¡ã¼ã¸ã«ã¤ã1ã¤ã®
ãã¼ã¢ã³
ãåãããã«ä½ãã¾ã- ä»åã®å ´åã¯ã
nginx
,php-fpm
,mysqld
ããã¼ã¢ã³ã«ãªãã¾ã
- ä»åã®å ´åã¯ã
- ã¤ã¡ã¼ã¸ã¯ã¼ãããä½ããã¨ãã§ããããä»ã®ã¤ã¡ã¼ã¸ãå ã«ãã¦ä½ããã¨ãã§ãã¾ã
- Docker Hub ã«
Docker ã¤ã¡ã¼ã¸
ãå¤æ°å ±æããã¦ããã®ã§ããããæ´»ç¨ãããã¨ãå¯è½
ã¤ã¡ã¼ã¸
ããã³ã³ãã
ãèµ·åãã¾ãã³ã³ãã
ã¯1ã¤ã®ããã»ã¹ã§ã1ã¤ã®ãã¼ã¢ã³ãåãã¦ãã¾ãããã®ãã¼ã¢ã³
ãæ¢ã¾ãã¨ãã³ã³ãã
ã¯çµäºãã¾ã
docker-compose.yaml
ã¨ãã yaml ã®ãã¡ã¤ã«ãæ¸ãã¦ãdocker-compose
ã³ãã³ããå®è¡ãããã¨ã§ãè¤æ°ã®ã³ã³ãã
ãã¾ã¨ãã¦èµ·åããå調ãã¦åããããã«ãã¾ã
ã¨ããæãã§ãã
Docker åãã¦ã ã¨ããããããªãããããã¾ããããè¨å®ãã¡ã¤ã«è¦ã¦è§¦ã£ã¦è¦ããã»ããæ©ãã§ãã®ã§ãããããããªãã¦ã次é²ã¿ã¾ãããã
ãã£ã¬ã¯ããªæ§æ
以ä¸ã®ãããªæ§æã«ãã¾ãã
âââ application ï¼ããã«ããã¸ã§ã¯ããã¡ã¤ã«ãå ¥ãæ³å®ï¼ â  âââ initial.sqlãï¼ãã¼ã¿ãã¼ã¹ã®åæã®SQLãå ¥ã£ã¦ãããã¡ã¤ã«ï¼ âââ docker â  âââ docker-compose.ymlãï¼docker-compose ã®è¨å®ãã¡ã¤ã«ï¼ â  âââ misc â  â  âââ dataãï¼MySQLã®ãã¼ã¿ãã©ã«ããå ¥ããã£ã¬ã¯ããªï¼ â  âââ nginx â  â  âââ Dockerfile â  â  âââ fastcgi.conf â  â  âââ localhost.crt â  â  âââ localhost.csr â  â  âââ localhost.key â  â  âââ nginx.conf â  â  âââ server.conf â  âââ php-fpm â  âââ Dockerfile â  âââ php.ini âââ publicãï¼nginx ã®ããã¥ã¡ã³ãã«ã¼ãï¼ âââ index.phpãï¼ãã¹ãç¨ã® PHP ãã¡ã¤ã«ï¼
ãã£ããåããã¦ã¿ãã
ä»åã®è¨äºã§ä½æãããã¡ã¤ã«ã github ã«ããã¦ããã¾ãã®ã§ããã¡ãããã¼ã¹ã«èª¬æãã¦ããã¾ãã
Docker for Mac / Docker for Windows ã®ã¤ã³ã¹ãã¼ã«
ã¾ã㯠以ä¸ã®ãã¼ã¸ãã Docker for Mac (ã¾ã㯠Docker for Windows )ãã¤ã³ã¹ãã¼ã«ãã¾ããå®å®çã¨ãã¼ã¿çãããã¾ãããå®å®ç(stable)ãé¸ãã§ããã¾ãããã
Get started with Docker for Mac | Docker Documentation
æ示ã«å¾ã£ã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã
ããã§ãdocker
ã³ãã³ããdocker-compose
ã³ãã³ãã使ããããã«ãªãã¾ããã
Mac ã®å ´åãå³ä¸ã§ç¶æ³ã確èªã§ããããã«ãªãã¾ããã¯ã¸ã©ã®ã¢ã¤ã³ã³ããã¥ã¼ãã§ããã
ã½ã¼ã¹ã³ã¼ãã®å±é
ç¶ãã¦ãä»åä½æãããã¡ã¤ã«ãç½®ããããªãã¸ããªããããã¡ã¤ã«ããã¦ã³ãã¼ããã¾ãã
$ git clone [email protected]:koni/docker-php-nginx-mysql-memcached.git
ãã«ãï¼èµ·å
ç¶ãã¦ãã«ãï¼èµ·åãã¾ããååã¯å¤å°æéããããã¾ããã2åç®ããã¯æ°ç§ã§èµ·åãã¾ãã
$ cd docker-php-nginx-mysql-memcached/docker $ docker-compose up
ç¡äºã«æåããã¨ããã°ãåºå§ãã¾ãã
ãã㧠MAMP ã Apache, nginx ãªã©ãTCP80, 443, 13306 ãã¼ããLIESTENãã¦ããããã»ã¹ãããã¨ã以ä¸ã®ãããªã¨ã©ã¼ãã§ã¾ãã
ä»ã®ããã»ã¹ãçµäºãã¦ããå度 docker-compose up
ãå®è¡ãã¾ãããã
ERROR: for nginx Cannot start service nginx: driver failed programming external connectivity on endpoint nginx (9ad3d10cef4673ee7a48fbd6c7c59fbe6f3043eeac8eb0e27797da03cfbfa60b): Bind for 0.0.0.0:443 failed: port is already allocated ERROR: Encountered errors while bringing up the project.
åä½ç¢ºèª
ãã°ãæ¢ã¾ã£ããããã©ã¦ã¶ã§ http://localhost/ ã«ã¢ã¯ã»ã¹ãã¾ãã 以ä¸ã®ãããªè¡¨ç¤ºãåºããæåã§ãã
nginx ã®ããã¥ã¡ã³ãã«ã¼ãã«ãããã¹ãç¨ã® PHPãã¡ã¤ã«ï¼public/index.php
ï¼ãå®è¡ããã¾ãããã®ãã¡ã¤ã«ã§ã¯ MySQL ã«ã¤ãªãã§ããã¼ã¿ã INSERT ããSELECT ããã®ã§ããªãã¼ããããã³ã«æ°åãå¢ãã¦ããã¯ãã§ãã
ä»åã®åä½ã®æ¦å¿µå³
åãã¡ã¤ã«ã®èª¬æ
ã§ã¯ãåãã¡ã¤ã«ã«ã¤ãã¦è¦ã¦ããã¾ãããã
docker-compose.yaml
ãã®ãã¡ã¤ã«ããããã£ã¬ã¯ããªã§ãdocker-compose up
ã³ãã³ããå®è¡ããã¨ããã®ãã¡ã¤ã«ã使ã£ã¦ã³ã³ããã®èµ·åã試ã¿ã¾ãã対å¿ããã¤ã¡ã¼ã¸ãã¾ã ãªãå ´åã¯ãèªåçã«ã¤ã¡ã¼ã¸ãçæããã¾ããå¿
è¦ãªãã¡ã¤ã«ããã¦ã³ãã¼ããã¦ã¤ã¡ã¼ã¸ãä½æããã®ã§ãååã¯æéããããã¾ãããä¸åº¦ã¤ã¡ã¼ã¸ãä½ãããã¨ãã®ä½æ¥ã¯ãªãã®ã§1,2ç§ã§èµ·åã§ããããã«ãªãã¾ãã
docker-compose.yaml
ã«ã¯ãèµ·åãããã³ã³ããã¨ããããããå調ãã¦åãããã®è¨å®ãè¨è¿°ãã¾ãã
docker-compose ã®æ¸ãæ¹
version
㯠'2' ã§åºå®ã§ãã
services
以ä¸ãããããã®ã³ã³ããã®è¨å®ã§ãã
ports
ã使ãã¨ãã³ã³ããå
ã®ãã¼ãã¨ãã¼ã«ã«ã®ãã¼ãã«ãã¤ã³ãã§ãã¾ããã³ãã³(:)ã®å·¦ããã¼ã«ã«ã®ãã¼ããå³ãã³ã³ããå
ã®ãã¼ãã§ããMySQL ã³ã³ããã§ã¯ããã¼ã«ã«ããç´æ¥ã³ã³ããã® MySQL ã«ã¢ã¯ã»ã¹ã§ããã¨ä¾¿å©ãªã®ã§ãã³ã³ããã® 3306 ããã¼ã«ã«ã® 13306 ã«ãã¤ã³ããã¾ãã3306 ã§ãªã 13306 ã«ãã¦ããã®ã¯ãæ¢ã« MySQL ããã¼ã«ã«ã§åãã¦ããã¨ãããã£ã³ã°ãã¦ãã¾ãããã§ãããã®æ°åã¯ãªãã§ããã¾ãã¾ããã
volumes
ã¨ä½¿ãã¨ãã³ã³ããå
ã®ãã£ã¬ã¯ããªããã¼ã«ã«ã®ãã£ã¬ã¯ããªã«ãã¤ã³ãã§ãã¾ããã³ãã³(:)ã®å·¦ããã¼ã«ã«ã®ãã£ã¬ã¯ããªãå³ãã³ã³ããã®ãã£ã¬ã¯ããªã§ãã
container_name
ã§ã³ã³ããã«ååãã¤ãããã¨ãã§ãã¾ããããã¯å¿
é ã§ã¯ãªãã§ãããdocker-compose exec
ã§ã³ã³ããå
ã«å
¥ãæã«ãæã¤æåæ°ãæ¸ãã®ã§ä¾¿å©ã§ãããã ããåãã³ã³ããåã§è¤æ°ã®ã³ã³ãããèµ·åã§ããªãã®ã§ã1ã¤ã«åºå®ãã¦ããã¨ãåæã«1ã¤ããåãã³ã³ãããèµ·åã§ããªããªãã¾ãã
links
ã使ãã¨ããã®ååã§ä»ã®ã³ã³ããã«ã¢ã¯ã»ã¹ã§ããããã«ãªãã¾ãã
ããã使ãã°ã³ã³ããã®IPãç¥ããªãã¦ãä»ã®ã³ã³ããã«ã¢ã¯ã»ã¹ã§ãã¾ãã
ä¾ãã°ãweb
ã«links: mysql
ã¨ããã®ã§ãnginx ã³ã³ããå
ããã¯ãmysql
ã¨ãããã¹ãåã§mysqlã«ã¢ã¯ã»ã¹ã§ããããã«ãªãã¾ãããã®å ´åãã¢ããªå´ã®DBã®è¨å®ãã¡ã¤ã«ã®ãã¹ãã®æ¬ã«ã¯ mysql
ã¨æ¸ãã°æ¥ç¶ã§ããããã«ãªãã¾ãããããªæãã§ãããã®ä¾ã§ã¯`docker-compose.yaml ããç°å¢å¤æ°ã§ãã¹ãåã渡ãã¦ãã¾ãã
memcached
services: memcached: image: memcached:1.4
ããã¯ãmemcached:1.4
ã¤ã¡ã¼ã¸ã§èµ·åãããã¨ããè¨å®ã§ãããã¼ã«ã«ã«ã¤ã¡ã¼ã¸ããªãå ´åã¯ãDocker Hub ããèªåçã«åå¾ããã¾ããä»åã¯ãããããåå¾ããã¾ãã
mysql
data: image: busybox volumes: - ./misc/data:/var/lib/mysql mysql: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: mysql_database MYSQL_USER: mysql_user MYSQL_PASSWORD: mysql_pw ports: - "13306:3306" volumes_from: - data volumes: - ../application/initial.sql:/docker-entrypoint-initdb.d/initial.sql container_name: mysql
ãã¡ããã¤ã¡ã¼ã¸ã¯ Docker Hubã®ãªãã£ã·ã£ã«ãªãã¸ããªããåå¾ããã¾ãã
ãã®ã¤ã¡ã¼ã¸ã§ã¯ãMYSQL_ROOT_PASSWORD
, MYSQL_DATABASE
, MYSQL_USER
, MYSQL_PASSWORD
ã¨ããç°å¢å¤æ°ãè¨å®ãã¦ããã¨ãèªåçã«ROOTãã¹ã¯ã¼ããè¨å®ããã¦ã¼ã¶ã¼ã¨ãã¼ã¿ãã¼ã¹ãä½æãã¦ãããæ©è½ãããã®ã§ãç°å¢å¤æ°ãè¨å®ãã¦ããã¾ããã¡ãªã¿ã«ããã®å¦çã¯ãã¼ã¿ãã¼ã¹ããªãã¨ãã ãè¡ããã¾ããä¸åèµ·åããã¨ãã®å¦çã¯è¡ããã¾ãããmisc/data
以ä¸ãæ¶ãã¨ãå度ã¦ã¼ã¶ã¼ã¨ãã¼ã¿ãã¼ã¹ãä½æããã¾ãã
ã¾ããã®ã¤ã¡ã¼ã¸ã«ã¯ã/docker-entrypoint-initdb.d/*.sql
ã¨ãããã¡ã¤ã«ãç½®ãã¦ããã¨ãèµ·åæã«ãããå®è¡ãã¦ãããæ©è½ãããã®ã§ãvolumes
ã使ã£ã¦ãããã«ã¢ããªã±ã¼ã·ã§ã³ã®DBã¹ãã¼ããããã¦ããã¾ããä»åã¯ãã¹ããªã®ã§ãhoges
ã¨ãããã¼ãã«ãä½æããCREATE TABLE
æã ãããã¦ããã¾ããå®éã«ã¯ããã§ã¢ããªã±ã¼ã·ã§ã³ã®DBã¹ãã¼ããæ¸ããããã¡ã¤ã«ã®ãã¹ãæå®ãã¾ãã
ã³ã³ããã¯çµäºããã¨ãã¼ã¿ãæ¶ãã¦ãã¾ãã¾ããã³ã³ãããçµäºãããã³ãã¼ã¿ãæ¶ããã¨éçºä¸ä¸ä¾¿ãªã®ã§ãbusybox
ã使ã£ã¦MySQLã®ãã¼ã¿ã¯ã³ã³ããå¤ã«ããã¦ãããã¨ã«ãã¾ãã
ãã¼ã«ã«ã®./misc/data
ããã³ã³ããå
ã® /var/lib/mysql
ã«ãã¤ã³ããã¾ããããã§ãmisc/data
ã«MySQLã®ãã¼ã¿ãããç¶æ
ã«ãªãã®ã§ãã³ã³ãããçµäºãã¦ããã¼ã¿ã¯æ¶ãã¾ããããã¼ã¿ãæ¶ãããã¨ãã¯ãmisc/data
以ä¸ãåé¤ããã°OKã§ãã
git ã§ç®¡çããå ´åã¯ããã®ãã£ã¬ã¯ããªã¯ .gitignore
ãã¦ãããã¨ããããããã¾ãã
nginx
nginx: build: ./nginx ports: - "80:80" - "443:443" volumes: - ../:/var/www/html links: - web container_name: nginx
ä»åº¦ã¯ image
ã§ã¯ãªãã build
ãããã¾ãã
ã¤ã¡ã¼ã¸å
ã®nginxã®è¨å®ãã¡ã¤ã«ã«å¤æ´ãå ãããã®ã§ãå¥é Dockerfile
ã使ã£ã¦ã¤ã¡ã¼ã¸ããã«ãããããã«ãã¾ãã
nginx/Dockerfile
ãã®ãã¡ã¤ã«ã§ nginx ã¤ã¡ã¼ã¸ããã«ããã¾ãã
FROM nginx ADD nginx.conf /etc/nginx/nginx.conf ADD fastcgi.conf /etc/nginx/fastcgi.conf ADD server.conf /etc/nginx/conf.d/default.conf ADD localhost.key /etc/ssl/private/localhost.key ADD localhost.crt /etc/ssl/certs/localhost.crt
FROM nginx
ã¨ããã®ã§ãDocker Hub ã®ãªãã¸ããªãããã¼ã¹ã®ã¤ã¡ã¼ã¸ããã¦ã³ãã¼ãããã¾ãã
ãããããè¨å®ãã¡ã¤ã«ãããã¤ããå¤æ´ãã¾ãã
ä»å㯠nginxã®è¨å®ãã¡ã¤ã«ã§ãããnginx.conf
ããã¼ãã¨å¦çã®å¯¾å¿ã®è¨å®ã§ããserver.conf
ãnginxã¨PHP-FPMã¨ã®é£æºã®è¨å®ã§ãã fastcgi.conf
ãå¤æ´ãã¾ãã
ã¾ãããã¾ãã¨ãã¦ãèªå·±ç½²åããSSL証ææ¸ãããã¦ããã¾ããè¨äºæå¾ã®æé ãå®è¡ããã¨ãhttps://localhostã§ãã¢ã¯ã»ã¹ã§ããããã«ãªãã¾ãã
web (PHP-FPM)
web: build: ./php-fpm volumes: - ../:/var/www/html links: - mysql environment: DATABASE_HOST: 'mysql' DATABASE_NAME: 'mysql_database' DATABASE_USER: 'mysql_user' DATABASE_PASSWORD: 'mysql_pw' container_name: web
volumes
ã§ãããã¸ã§ã¯ãã«ã¼ã㨠/var/www/html
ããã¤ã³ããã¦ããã¾ããããã§ãã³ã³ããèµ·åä¸ã«ã½ã¼ã¹ã³ã¼ããä¿®æ£ãã¦ãããã«ç¢ºèªãããã¨ãã§ãã¾ãã
environment
ãå©ç¨ãã¦ãã¢ããªã®å®è¡è¨å®ãç°å¢å¤æ°ã§æ¸¡ããã¨ãã§ãã¾ããä»åã¯DBã¸ã®æ¥ç¶ã®è¨å®ã渡ãã¾ããã
ãã使ãã³ãã³ã
ã¤ã¡ã¼ã¸ã®ãã«ã
$ docker-compose build
èµ·å
$ docker-compose up
çµäº
$ docker-compose stop
èµ·åä¸ã®ã³ã³ãããè¦ã
$ docker ps
ã³ã³ããã«å ¥ã
ãã°ãã¡ã¤ã«ããè¨å®ãã¡ã¤ã«ã®ä½ç½®ã®ç¢ºèªãªã©ã§ãã³ã³ããã«å ¥ãã¨ãã¯ä»¥ä¸ã使ãã¾ãã
$ docker exec -it mysql bash root@a0d91988b7db:/# # ã³ã³ããã«å ¥ãã
mysql
ã®é¨åã«ã¯ãã³ã³ããå (docker-compose.yaml
ã® container_name
)ããã³ã³ããID (docker ps
ã³ãã³ãã®åºåã® CONTAINER ID
ï¼ãå
¥ãã¾ãã
ãã®ä»ä½¿ãæ¹ã¡ã¢
ã³ã³ããã®MySQLã«æ¥ç¶ããã
MySQL ã¯ã©ã¤ã¢ã³ãã§ä»¥ä¸ã®ããã«è¨å®ããã¨ãã³ã³ããã® MySQL ã«å ¥ãã¾ãããã¡ãã mysql ã³ã³ãããèµ·åãã¦ããªãã¨å ¥ãã¾ããã
Host: 127.0.0.1:13306 User: mysql_user PW: mysql_pw Database: mysql_database
ã¿ããªå¤§å¥½ãSequelProãªããããªæãã§ããã
SSL ã§å ¥ããããã«ããã
ä»åããã¡ãã§çæããSSLèªå·±ç½²å証ææ¸ãå ¥ã£ã¦ããã®ã§ããã®è¨¼ææ¸ãä¿¡é ¼ããè¨å®ã«ããã°ãSSLã§æ¥ç¶ã§ãã¾ãã
ãã®è¨¼ææ¸ã¯ãèªå·±ç½²åãªã®ã§ãã®ã¾ã¾ã ã¨ãã©ã¦ã¶ã§ã¨ã©ã¼ãåºã¦ãã¾ãã¾ãã ãããåé¿ããããã«ãlocalost.crt ããã¼ãã§ã¼ã³ã¢ã¯ã»ã¹ã®ãã·ã¹ãã ãã¨ãã¦è¨¼ææ¸ãç»é²ãã¾ãã
$ open docker/nginx/localhost.crt
ä¸ã®ã³ãã³ããå®è¡ããã¨ãã¼ãã§ã¼ã³ã¢ã¯ã»ã¹ãèµ·åããã®ã§ããã·ã¹ãã ããé¸æãã証ææ¸ã追å ããã ããã¼ãã§ã¼ã³ã¢ã¯ã»ã¹ããèµ·åãããã·ã¹ãã ããé¸æãä»è¿½å ãã証ææ¸ï¼ååããlocalhostãã«ãªã£ã¦ããï¼ãããã«ã¯ãªãã¯ããããã®è¨¼ææ¸ã使ç¨ããã¨ããæ¬ãã常ã«ä¿¡é ¼ãã«ããç»é¢ãéãããç»é¢ãéããã¨ãã«ä¿åãããã®ã§ãå¿ ãç»é¢ãéããã
SSL èªå·±ç½²å証ææ¸ã®ä½ææé
ãªãã¸ããªã«å«ã¾ãã¦ãã証ææ¸ã¯ã以ä¸ã®æé ã§ä½æãããã®ã§ãã
$ openssl genrsa 2048 > localhost.key $ openssl req -new -key localhost.key > localhost.csr $ openssl x509 -req -days 3650 -signkey localhost.key < localhost.csr > localhost.crt
ã¾ã¨ã
ã¨ããããã§ãããã§éçºç°å¢ãã³ãã³ãä¸çºã§èµ·åã§ããããã«ãªãã¾ããã
ããã git ãªã©ã§ã¡ã³ãã¼ã«å
±æãã¦ãã¡ã³ãã¼ã«ã¯ãDocker for Mac å
¥ãã¦ãdocker-compose up
å®è¡ãã¦ãã¨ä¼ããã ãã§éçºç°å¢ã®æ§ç¯ãæ¸ãããã«ãªãã¾ããã
ï¼å®£ä¼ï¼ æ ªå¼ä¼ç¤¾AutoScaleã§ã¯ããã®ç°å¢ã使ã£ã¦ãTwitterãã©ãã¯ã¼ç®¡çã»éç¨æ¯æ´ãã¼ã« Cheetah ã¨ãããµã¼ãã¹ãéçºãã¦ãã¾ãï¼ Twitter ã¢ã«ã¦ã³ãããæã¡ã®æ¹ã¯ããã²ã試ããã ããï¼
åè
DevOpså°å ¥æå Infrastructure as Codeã§ãã¼ã éçºã»ãµã¼ãã¹éç¨ãå¹çåãã
ãã®æ¬ã¯ã2016å¹´10æçºå£²ã¨æ°ããã®ã§ãDocker for Mac ã«ã¤ãã¦ãæ¸ãã¦ãããéçºã®éç¨ã«ã¤ãã¦ããªãå ·ä½çã«æ¸ãã¦ããããããã§ãã
Compose ファイル・リファレンス — Docker-docs-ja 17.06.Beta ドキュメント
è¿½è¨ (2017.9.28)
ãã¢ãã³ãã¨è¡ã£ã¦ãããªãã PHP 5.6 ã ã£ãã®ã§ãPHP 7.1 ã«å¯¾å¿ããã¾ããã
PHP5.6 ã«å¯¾å¿ããããå ´åã¯ãdocker-compose.yml
ã build: ./php-fpm56
ã«ãã¦ãã ããã