version: '3.8'

services:
  nginx:
    image: nginx:alpine  # 使用轻量级 alpine 版本
    container_name: nginx-web
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "9100:9100"
    volumes:
      # 挂载配置文件
      - /home/lq/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro
      - /home/lq/nginx/conf.d:/etc/nginx/conf.d:ro
      - /home/lq/nginx/conf/app_conf/:/etc/nginx/app_conf:ro
      # 挂载网站文件
      - /home/lq/nginx/html:/usr/share/nginx/html:ro
      - /home/lq/nginx/html_app:/usr/share/nginx/html_app:ro
      # 挂载 SSL 证书
      - /home/lq/nginx/ssl:/etc/nginx/ssl:ro
      # 挂载日志
      - /home/lq/nginx/logs:/var/log/nginx
    environment:
      - TZ=Asia/Shanghai
    networks:
      - lq_network

networks:
  lq_network:
    external: true