Docker/Mariadb:启动用户空间代理时出错:监听 tcp {IP}:{PORT}:绑定无法分配请求的地址

Docker/Mariadb:启动用户空间代理时出错:监听 tcp {IP}:{PORT}:绑定无法分配请求的地址

我无法运行该命令:docker-compose up --build -d因为出现以下错误:

错误:对于 mariadb,无法启动服务 mariadb:驱动程序无法在端点 cdr_performance_tracker_mariadb_1 (c98f1e65cf0226cfd2ea3e5493d8a13eb2dc14d1ea4194cae31f0789090d6172) 上编程外部连接:启动用户空间代理时出错:监听 tcp4 {IP}:{PORT}:绑定:无法分配请求的地址错误:启动项目时遇到错误。

这是我的 docker-compose 文件:

version: '3'

services:
    app:
        restart: always
        build: ./app
        ports:
            - {IP Where the app is hosted on AWS}:8501:8501
        environment:
            STREAMLIT_DB_HOST: mariadb
            STREAMLIT_DB_NAME: db
            STREAMLIT_DB_USER: username
            STREAMLIT_DB_PASSWORD: password
        depends_on:
            - mariadb
        networks:
            - streamlit_network
        command: streamlit run Main.py
    mariadb:
        image: mariadb:10.5.17
        ports:
            - {IP where MARIADB is hosted}:3306:3306
        volumes:
            - db_data:/var/lib/mysql
            - db_conf:/etc/mysql/conf.d
        environment:
            MARIADB_DATABASE: opsearch
            MARIADB_ROOT_PASSWORD: rootPassword
        networks:
            - streamlit_network
    nginx:
        restart: always
        build: ./nginx
        ports:
            - "80:80"
        depends_on:
            - app
            - mariadb
volumes:
    db_data:
    db_conf:
networks:
    streamlit_network:
        driver: bridge
~                                    

我在 AWS Lightsail 上的 Ubuntu VM 中运行它。任何关于如何解决这个问题的指示。

相关内容