0

After Running the Container mongodb port 27017 is running fine but mongodb-express failed and getting the below error

version: "3.8"
services:
  mongodb:
    image: mongo
    container_name: mongodb
    ports:
      - 27017:27017
    volumes:
      - data:/data
    environment:
      MONGO_INITDB_ROOT_USERNAME: rootuser
      MONGO_INITDB_ROOT_PASSWORD: rotpass
  mongo-express:
    image: mongo-express
    container_name: mongo-express
    ports:
      - "8081:8081"
    environment:
      ME_CONFIG_MONGODB_ADMINUSERNAME: rootuser
      ME_CONFIG_MONGODB_ADMINPASSWORD: rotpass
      ME_CONFIG_MONGODB_SERVER: mongodb
volumes:
    data: {}

networks:
    default:
        name: mongo-network

Cannot start Docker Compose application. Reason: compose [start] exit status 1. Container mongodb Starting Container mongo-express Starting Container mongodb Started Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:8081 -> 0.0.0.0:0: listen tcp 0.0.0.0:8081: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

  • Change the Port but still getting the error
  • Also try searching any task is perform under that port : but there are 0 tasks

Anyone know how to fix this issue ?

enter image description here

0 Answers0