Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steinskeeper/fastapi-postgres-docker
FastAPI + Postgres + Docker Compose + Heroku Deploy Template
https://github.com/steinskeeper/fastapi-postgres-docker
alembic docker fastapi heroku migration postgres sqlalchemy
Last synced: 3 months ago
JSON representation
FastAPI + Postgres + Docker Compose + Heroku Deploy Template
- Host: GitHub
- URL: https://github.com/steinskeeper/fastapi-postgres-docker
- Owner: steinskeeper
- Created: 2021-10-06T03:51:24.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-13T13:44:20.000Z (about 2 years ago)
- Last Synced: 2024-04-30T23:33:29.956Z (6 months ago)
- Topics: alembic, docker, fastapi, heroku, migration, postgres, sqlalchemy
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 13
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI + Postgres + Docker Compose + Heroku Deploy
### Features
1. FastAPI with Postgres setup
2. Docker container with docker-compose
3. JWT User Authentication
4. Modular Project Structure
5. Heroku Deploy with Githu Actions
6. Manage Migrations with Alembic script# TO-DO when Running on Local Machine
1. Change `entrypoint.sh` file from
```
#!/bin/bash
alembic upgrade head
uvicorn app.server:app --reload --host 0.0.0.0 --port $PORT
```
To
```
#!/bin/bash
alembic upgrade head
uvicorn app.server:app --reload --host 0.0.0.0 --port 5000
```# If there is any changes to Database Schema
1. `$ sh mig.sh`
Example
```
sh mig.sh
Enter the Migration File name :
cluster groups org
```
The resulting file name will be
`21ce965c935e_cluster_groups_org.py`2. Commit the migration files.
# When Pushing to Main
1. Change back --port 5000 to --port $PORT in `entrypoint.sh`