s3rius / FastAPI-template

Feature rich robust FastAPI template.
MIT License
1.9k stars 164 forks source link

DB Access on local #77

Closed WP-LKL closed 2 years ago

WP-LKL commented 2 years ago

3.3.0

WP-LKL commented 2 years ago

Possibly restructure the readme with a local development section

Local Development

If you want to develop in docker with autoreload, use this command:

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

This command exposes application on port 8000, mounts current directory and enables autoreload.

But you have to rebuild image every time you modify poetry.lock or pyproject.toml with this command:

docker-compose -f deploy/docker-compose.yml --project-directory . build

Docs: http://localhost:8000/api/docs

Database: localhost:5432

WP-LKL commented 2 years ago

Not ready as in not compatible with cookiecutter templates not including db

s3rius commented 2 years ago

Hi, and thanks for contributing.

I'm not sure that exposing database is something that really needed by default, because many people have databases up and running locally with default ports. Although it may be useful for someone, it's not that hard to add ports in docker-compose.dev.yml, since we already have a good example how to expose ports.

WP-LKL commented 2 years ago

Yes, I agree.