|
||
---|---|---|
migrations | ||
src | ||
static/avatars | ||
.dev.Dockerfile | ||
.dev.env | ||
.dockerignore | ||
.gitignore | ||
.local.env | ||
.prod.Dockerfile | ||
.prod.env | ||
Pipfile | ||
Pipfile.lock | ||
README.md | ||
alembic.ini | ||
requirements.txt |
README.md
Initialization
Virtue Environment
First install pipenv
(if you don't have) running:
pip install pipenv
Then use pipenv
to create virtue environment running in the root directory of the project:
pipenv install
This command will install all the dependencies.
Requirements
Generate requirements file running
pipenv requirements > requirements.txt
Start Up
Start up the app according to different environment variables running:
fastapi
uvicorn src.main:app --reload --env-file ./.local.env
Migration
Generate a migration
alembic revision -m "comment" --autogenerate
Upgrade a migration
This will upgrade to the newest version
alembic upgrade head
or:
alembic upgrade verions_name
or relative upgrades:
alembe upgrade +1
Downgrade a migration
alembic downgrade -1
Run Container
Create a volume for persisting data:
docker volumn create together-backend
Run a container and mount the volume:
docker run --name together-backend \
-v together-backend:/backend/static \
-itd 120.77.202.88/together-backend-dev:v1.0