Skip to content

IBBD/dockerfile-nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nginx Dockerfile

基础镜像

  • docker pull nginx
  • 最新稳定版

安装

  • 从dockerfile编译
git clone [email protected]:IBBD/dockerfile-nginx.git
cd dockerfile-nginx

sudo docker build -t ibbd/nginx ./
  • 直接从hub.docker.com下载镜像
docker pull ibbd/nginx

Usage

  • 简单应用
docker run -d -p 80:80 ibbd/nginx
  • 比较完整的应用
# 代码目录
code_path=/var/www

# nginx配置目录
conf_path=/etc/nginx/nginx-conf/product-env

# nginx日志目录
logs_path=/var/log/nginx

current_path=$(pwd)
docker run --name=ibbd-nginx -d \
    -p 80:80 \
    --link ibbd-php-fpm:php-fpm \
    -v $code_path:/var/www \
    -v $logs_path:/var/log/nginx \
    -v $conf_path:/etc/nginx/sites-enabled:ro \
    -v $current_path/conf/nginx.conf:/etc/nginx/nginx.conf:ro \
    --volumes-from ibbd-php-fpm \
    ibbd/nginx 

完整代码见:./run.sh.example

说明:

  • 需要先从镜像 ibbd/php-fpm 上启动容器 ibbd-php-fpm

About

IBBD Nginx Dockerfile

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published