Docker compose - port not being forwarded

Hello,

I am using docker compose to tie together a couple of services, but I can’t seem to get port forwarding to work. This is a .NET Core webapi.

Here’s my docker-compose.yml:

version: '3.8'

networks:
  extract-core:
    name: extract-core
    driver: bridge

services:
  extract-api:
    container_name: extract-api
    build: Extract/
    restart: always
    networks:
      - extract-core
    ports:
      - "5110:5110"
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=http://+:5110

Whenever I try to access ‘http://localhost:5110’ on my local host (using curl for example), I get:

curl: (52) Empty reply from server

Am I missing something ?

Please, use the code block button (</>) when you insert code, especially when it is yaml in which indentation matters. You can also do it manually by replacing your three dashes with three “`” (backtick) character :slight_smile: I fixed it.

Back to the issue. It looks like your port was forwarded but the server sent back an empty response. Is it possible that your server requires HTTPS conection and not plain HTTP?