In this industry, Technology have been advancing rapidly.
This time, I will create new project. and this is a private project.
So, I decide to build the latest Technology.
I think I public this attempt. I hope that this article is useful.
Enviroment
- mac Yosemite
Using Technology
- docker
- nginx
- php-fpm
- php5.5
- laravel
- anguler.js
- MongoDB
- foundation
- jenkins
- Hubot
- slack
- arduino
Docker
This project use docker.
docker is an open platform for distributed applications for developers and sysadmins.
Currently, I don't want to use this Technology by big project. But this time, small project like startup. I will try docker.
install docker
brew update brew install docker boot2docker // docker version docker -v Docker version 1.5.0, build a8a31ef // iso image download boot2docker init // boot2docker launch boot2docker up // export To connect the Docker client to the Docker daemon, please set: export DOCKER_HOST=tcp://192.168.59.103:2376 export DOCKER_CERT_PATH=/Users/msuzuki/.boot2docker/certs/boot2docker-vm export DOCKER_TLS_VERIFY=1 boot2docker status running
use docker
// move project folder cd {projectfolder} // crate docker file touch Dockerfile // write docker file vi Dockerfile
Dockerfile
FROM centos:6.6 MAINTAINER Edy # yum update RUN yum -y update # install nginx RUN rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm RUN yum -y install nginx # install php RUN rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm RUN rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm RUN yum install -y http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm RUN yum install -y --enablerepo=remi-php55 php php-mbstring php-mcrypt php-devel php-fpm # Expose ports. EXPOSE 80 # EXPOSE 443 # launch nginx ENTRYPOINT ["/usr/sbin/nginx", "-g", "daemon off;"]
docker image cent os 7 is instability. use centos:6.6.
Run docker
// build Dockerfile docker build -t development001 . // confirm docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE develop001 latest 9da6bf054ea6 45 minutes ago 611.7 MB // docker run docker run -i -t --name dev001 9da6bf054ea6 /bin/bash // nginx version nginx -v nginx version: nginx/1.6.2 // php version php -v PHP 5.5.22 (cli) (built: Feb 18 2015 17:54:45) // php-fpm version php-fpm -v PHP 5.5.22 (fpm-fcgi) (built: Feb 18 2015 17:55:52) // nginx start nginx // confirm curl http://localhost:80/ // exit exit
Access docker from Mac
// launch nginx container docker run -d -i -p 80:80 -t development001:latest // setting port forwarding VBoxManage controlvm "boot2docker-vm" natpf1 "nginx,tcp,127.0.0.1,3000,,80" // browser access http://localhost:3000
docker was ready. Next operation is setting nginx and php-fpm coordination.
以上。
参考サイト