nginx docker-compose版本

version: '3'
services:
  nginx:
    image: nginx:latest
    container_name: nginx
    ports:
      - "80:80"
      - "443:443"
    # 注意:首次启动,需要先注释掉volumes,启动后把docker容器中的文件复制(docker cp)到对应目录后,再放开注释。
    volumes:
      - /opt/nginx/conf/:/etc/nginx/
      - /opt/nginx/html/:/usr/share/nginx/html/
      - /opt/nginx/logs/:/var/log/nginx/
      # 简化版
      # - /opt/nginx/nginx.conf:/etc/nginx/nginx.conf
    restart: always
posted @   左岸丶  阅读(54)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2020-09-12 python UnitTest
2020-09-12 python date与datetime
2020-09-12 python pip超时
2019-09-12 lsof常用命令(lists openfiles)
2019-09-12 systemctl
点击右上角即可分享
微信分享提示