1
0
forked from finn/site
Files
site/backend/README.md

45 lines
1.0 KiB
Markdown
Raw Normal View History

2024-08-01 22:21:07 -07:00
## Workflow:
- should work with flask run locally and dockerfile build
- local dev
- local / venv pip install
- record versionless pips manually here
- pip freeze snapshots into project requirements
- docker build then copies frozen requirements
2024-08-01 06:35:28 -07:00
2024-08-01 03:53:33 -07:00
2024-08-01 22:21:07 -07:00
## pip:
2024-08-01 03:53:33 -07:00
```
2024-07-31 23:56:27 -07:00
pip install flask
pip install python-dotenv
2024-08-01 03:53:33 -07:00
pip install flask-wtf
2024-08-01 06:35:28 -07:00
pip install flask-sqlalchemy
pip install flask-migrate
2024-08-01 11:10:49 -07:00
pip install flask-login
pip install email-validator
2024-08-01 22:21:07 -07:00
...
2024-08-01 06:35:28 -07:00
pip freeze > requirements.txt
```
2024-08-01 22:21:07 -07:00
## db cheat:
2024-08-01 03:53:33 -07:00
```
2024-08-01 06:35:28 -07:00
flask db migrate -m "users table"
flask db upgrade
flask db downgrade [base]
flask db upgrade
```
2024-08-01 22:21:07 -07:00
## build notes:
Dockerfile needs dockerignore or preferably explicitly defined copies for:
- app
- config
- project dir
- requirements
- not dotflaskenv, vars set with dockerfile
## notes:
- compose has entry that overrides flask with uwsgi for prod
- miminal environment vars come through project env, pass through compose
- no dotenv here, dotflaskenv goes into image
- keep env untracked but templated, dotflaskenv is tracked and public