fastapi / full-stack-fastapi-template

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
MIT License
26.28k stars 4.6k forks source link

can't access the full-stack-fastapi-postgresql (running inside vagrant vm) from host machine #266

Closed ghazni123 closed 4 years ago

ghazni123 commented 4 years ago

Hi

I have setup the stack inside the vm created by vagrant (with creating the setup defined by https://dockerswarm.rocks/). ONly directly setup the stack inside the virtual machine

vagrant@vagrant:/vagrant/$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1fe5b95c243c dpage/pgadmin4 "/entrypoint.sh" 25 minutes ago Up 4 minutes 80/tcp, 443/tcp, 0.0.0.0:5050->5050/tcp pgadmin_1 76ad6cf25f40 mher/flower "flower --broker=amq…" 25 minutes ago Up 4 minutes 0.0.0.0:5555->5555/tcp flower_1 87bda7d3461d frontend:latest "nginx -g 'daemon of…" 25 minutes ago Up 5 minutes 80/tcp frontend_1 308de721e621 traefik:v2.2 "/entrypoint.sh --pr…" 25 minutes ago Up 4 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:8090->8080/tcp proxy_1 ed25baa2c098 postgres:12 "docker-entrypoint.s…" 25 minutes ago Up 5 minutes 5432/tcp db_1 368e4a8915e0 rabbitmq:3 "docker-entrypoint.s…" 25 minutes ago Up 5 minutes 4369/tcp, 5671-5672/tcp, 15691-15692/tcp, 25672/tcp queue_1

Inside vagrantfile i did forward all the ports mentioned in above table. None of following is working for me on host machine:

Frontend, built with Docker, with routes handled based on the path: http://localhost Backend, JSON based web API based on OpenAPI: http://localhost/api/ Automatic interactive documentation with Swagger UI (from the OpenAPI backend): http://localhost/docs Alternative automatic documentation with ReDoc (from the OpenAPI backend): http://localhost/redoc PGAdmin, PostgreSQL web administration: http://localhost:5050 Flower, administration of Celery tasks: http://localhost:5555 Traefik UI, to see how the routes are being handled by the proxy: http://localhost:8090 (this is understandable as I didn't set this up)

Does the stack needs to be installed on host machine only (and not inside the vagrant virtual machine)? Or maybe I am missing something please advise. Many thanks.

ghazni123 commented 4 years ago

resolved this.

tiangolo commented 3 years ago

Thanks for reporting back and closing the issue :+1: