-1
cd8eeeb21b2d   flask-test-flask-app   "bash ./export.sh"       14 seconds ago   Up 14 seconds             0.0.0.0:5001->5000/tcp, :::5001->5000/tcp   flask-container

Docker-compose

version: '3.8'
services:
  flask-app:
    container_name: flask-container
    restart: always
    build: .
    volumes:
      - '.:/app'
    ports:
      - 5001:5000
    
    

Error that i am getting

curl -X GET http://localhost:5001/test

Recv failure: Connection reset by peer

Atif Shafi
  • 954
  • 1
  • 11
  • 26

1 Answers1

0

You forwarded / published port 5001 of the host to port 5000 of the container. Therefore, the one you have to access on your host is 5001, bringing the complete command to curl -X GET http://localhost:5001/test.

Docker Docs about this: https://docs.docker.com/config/containers/container-networking/#published-ports

SIMULATAN
  • 833
  • 2
  • 17