$sudo docker run --name nginx -d -p 80:80 -v $PWD/nginx/nginx.conf:/etc/nginx/nginx.conf:ro nginx

docker-compose编排得例子

 

services:
  nginx:
    build: ./dockerfiles/nginx/
    container_name: nginx-server
    ports:
      - "80:80"
    links:
      - "php-fpm"
      - "webpack-dev-front"
    volumes:
#网站目录
      - ./app:/var/www/html
      - ./dockerfiles/nginx/conf.d:/etc/nginx/conf.d:ro
      - ./dockerfiles/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
#日志文件
      - ./logs/nginx:/var/log/nginx

分类:

技术点:

相关文章: