有没有知道“services.nginx.ports is ……"” 报错怎么解决?

有没有大神知道“services.nginx.ports is invalid: Invalid port "80: 80"” 报错怎么解决

刚刚接触nginx,配置了文件以后总是报错

image.png

version:"2"

services:
    mysql:
        container_name: solo-mysql
        image: mysal:5.7.13
        restart: always
        volumes:
            - /opt/docker/solo/mysql/data:/var/lib/mysql
            - /opt/docker/solo/mysql/logs:/logs
            - /opt/docker/solo/mysql/conf:/etc/mysql/conf.d
            - /etc/localtime:/etc/localtime:ro
        ports:
            - "3306:3306"
        environment:
            MYSOL_ROOT_PASSWORD: "123456"
            TZ: "Asia/Shanghai"
        command: --max_allowed_packet=32505856
    solo:
        container_name: solo
        image: b3log/solo:latest
        restart: always
        ports:
            - "8080:8080"
        environment:
            RUNTIME_DB:"MYSQL"
            JDBC_USERNAME: "root"
            JDBC_PASSWORD: "123456"
            JDBC_DRIVER: "com.mysql.jdbc.Driver"
            JDBC_URL: "jdbc:mysql://solo-mysql:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC"
            command: --listen_port=8080 --server_port= --server_scheme=http --server_host=192.168.1.232
    nanx:
        container_name: solo-nginx
        image: nainx:latest
        restart: always
    porte:
        - "80: 80"
        - "443:443"
    volumes:
        - /opt/docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
        - /ont/docker/nginx/conf/conf.d:/etc/nginx/conf.d
        - /opt/docker/nginx/html:/usr/share/nginx/html
        - /opt/docker/nginx/logs:/var/log/nginx
回复
阅读 450
1 个回答

docker-compose.yml 里面格式有问题,端口冒号后面多了空格。

不知道是不是粘贴的有问题,我这边看贴出来yml文件缩进有问题,ports也写成了porte。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏