基于Alpine构建php7+nginx(2)

参考: https://github.com/TrafeX/docker-php-nginx/tree/1.10.0

使用开源 Github

git clone https://github.com/TrafeX/docker-php-nginx.git
cd docker-php-nginx
git checkout 1.10.0

构建镜像

docker build -t trafex/alpine-nginx-php7 .

启动容器

docker run --rm -p 80:8080 trafex/alpine-nginx-php7

挂载

# 挂载运行目录
docker run -p 80:8080 -v ~/my-codebase:/var/www/html trafex/alpine-nginx-php7

# 挂载 nginx 配置文件
docker run -v "`pwd`/nginx-server.conf:/etc/nginx/conf.d/server.conf" trafex/alpine-nginx-php7

# 挂载 php 配置文件
docker run -v "`pwd`/php-setting.ini:/etc/php7/conf.d/settings.ini" trafex/alpine-nginx-php7

# 挂载 php-fpm 配置文件
docker run -v "`pwd`/php-fpm-settings.conf:/etc/php7/php-fpm.d/server.conf" trafex/alpine-nginx-php7

Last updated