1. version: '3.1'
    2. networks:
    3. base:
    4. services:
    5. nginx:
    6. image: nginx:1.21.4
    7. restart: always
    8. container_name: nginx
    9. environment:
    10. - TZ=Asia/Shanghai
    11. ports:
    12. - "80:80"
    13. volumes:
    14. - ./nginx/nginx.conf:/etc/nginx/nginx.conf
    15. - ./nginx/log:/var/log/nginx
    16. - ./nginx/html:/usr/share/nginx/html
    17. - /etc/letsencrypt:/etc/letsencrypt
    18. networks:
    19. - base