Docker-compose Ports are not available: /forwards/expose/port returned unexpected status: 500

0

Najpierw sprawdzilem recznie

  • czy buduje sie projekt z dockerfile (tak) docker build --no-cache --tag grupie -f Backend/Test/Test/Dockerfile .
  • czy moge uruchomic i udostepnic port 2000 (tak) docker run -d -p 2000:5000 --name test test

nastepnie chcialem to przeniesc do docker-compose
przy docker-compose up dostaje

ERROR: for test_test_1  Cannot start service test: Ports are not available: /forwards/expose/port returned unexpected status: 500

docker-compose.yml

version: '3.8'

networks:
  test-dev:
    driver: bridge 

services:
  test:
    image: test:latest
    depends_on:
      - "postgres"
    build:
      context: .
      dockerfile: Backend/Test/Test/Dockerfile
    ports:
      - "127.0.0.1:2000:5500" 
      - "127.0.0.1:2000:5501"  
    environment:
      DB_CONNECTION_STRING: "host=postgres;port=5432;database=Test;username=fasadin;password=S3h7VfQRrdCpqDK6"
    networks:
      - test-dev  

  grupieidentity:
    image: grupieidentity:latest
    depends_on:
      - "test"
    build:
      context: .
      dockerfile: Backend/Test/Test.IdentityServer/Dockerfile
    ports:
      - "127.0.0.1:2010:5510" 
      - "127.0.0.1:2011:5511"  
    environment:
      DB_CONNECTION_STRING: "host=postgres;port=5432;database=Test;username=fasadin;password=S3h7VfQRrdCpqDK6"
    networks:
      - test-dev  

  grupielanguages:
    image: grupielanguages:latest
    depends_on:
      - "test"
    build:
      context: .
      dockerfile: Backend/Test/Test.Languages/Dockerfile
    ports:
      - "127.0.0.1:2020:5520" 
      - "127.0.0.1:2021:5521"  
    environment:
      DB_CONNECTION_STRING: "host=postgres;port=5432;database=Test;username=fasadin;password=S3h7VfQRrdCpqDK6"
    networks:
      - test-dev  

  postgres:
    image: postgres:latest
    ports: 
      - "5432:5432"
    restart: unless-stopped
    volumes:
      - db_postgres_volume:/data/postgres
    environment:
      POSTGRES_USER: "fasadin"
      POSTGRES_PASSWORD: "S3h7VfQRrdCpqDK6"
      POSTGRES_DB: "Test"
    container_name: postgres
    networks:
      - test-dev

  pgadmin4:
    image: dpage/pgadmin4
    ports:
      - "127.0.0.1:5050:80"
    restart:
      unless-stopped
    depends_on:
      - "postgres"
    networks:
      - test-dev
    tty: true 
    environment:
      PGADMIN_DEFAULT_EMAIL: "[email protected]"
      PGADMIN_DEFAULT_PASSWORD: "S3h7VfQRrdCpqDK6"
    volumes:
       - viewdb_pgadmin_volume:/root/.pgadmin
volumes:
  db_postgres_volume:
  viewdb_pgadmin_volume:
2

dockerfile: Backend/Test/Test/Dockerfile
ports

  • "127.0.0.1:2000:5500"
  • "127.0.0.1:2000:5501"

Czy to nie tu masz problem? Próbujesz zmapowac 2 porty pod jeden?

1 użytkowników online, w tym zalogowanych: 0, gości: 1, botów: 0