Fetch the repository succeeded.
This project contains Dockerfiles that power apporz.com
-- my personal website.
I want to share my ideas and designs about Web-Deploying using Docker with you.
The whole app is divided into four Containers:
Nginx
Container. Recieves requests from Clients then respond.WWW
Container. It just stores php scripts and static files.PHP-FPM
Container, it fetches php scripts from WWW
then interpretes and executes them, making response to Nginx Server.
If necessary, it will connect to MySQL
server as well.MySQL
server must be independent of other containers.At first, you should have had Docker installed.
# build Nginx Image
$ sudo docker build --tag micooz/nginx -f nginx/Dockerfile .
# build PHP-FPM Image
$ sudo docker build --tag micooz/php-fpm -f php-fpm/Dockerfile .
# build WWW Image
$ sudo docker build --tag micooz/www -f www/Dockerfile .
# pull MySQL Official Image
$ sudo docker pull mysql:latest
You must run the contaners in the following sequence:
The first two of which can be exchanged.
# Run MySQL Container
$ sudo docker run --name mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql
# see https://github.com/docker-library/docs/tree/master/mysql
# Run WWW Container
$ sudo docker run --name www -d micooz/www
# Run PHP-FPM Container
$ sudo docker run --name php-fpm --volume-from www --link mysql:mysql -d micooz/php-fpm
# see https://github.com/docker-library/docs/tree/master/php
# Run Nginx Container
$ sudo docker run --name nginx -p 80:80 -p 443:443 --volume-from www --link php-fpm:fpmservice -d micooz/nginx
# see https://github.com/docker-library/docs/tree/master/nginx
Have fun!
Micooz micooz@hotmail.com
MIT
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。