FastAPI-template icon indicating copy to clipboard operation
FastAPI-template copied to clipboard

The address docker 0.0.0.0:8000 cannot be accessed from an external computer

Open yucelz opened this issue 1 year ago • 1 comments

Problem: The issue is that while all select components function correctly within the Docker environment, I can't access http://localhost:8000 from my computer.

Solution: To resolve this, it is necessary to include ALL port definitions/ mapping in the Docker Compose file. ex: ........ restart: always ports: - 8000:8000 env_file: - .env

yucelz avatar Aug 30 '24 09:08 yucelz

There is a dev file that can be included in your docker compose command to do the trick.

Try running:

docker compose -f docker-compose.yml -f deploy/docker-compose.dev.yml up

s3rius avatar Aug 30 '24 11:08 s3rius