1
0
forked from finn/site
site/backend
2024-08-03 04:59:42 -07:00
..
app mgt c6 checkpoint 2.2 2024-08-03 04:59:42 -07:00
migrations mgt c6 checkpoint 2.2 2024-08-03 04:59:42 -07:00
.flaskenv begin mg tut framework in be 2024-07-31 23:56:27 -07:00
config.py minor db config 2024-08-01 17:48:00 -07:00
Dockerfile mgt doc updates 2024-08-01 22:21:07 -07:00
microblog.py mgt c4 2024-08-01 06:35:28 -07:00
oldapp.py begin mg tut framework in be 2024-07-31 23:56:27 -07:00
README.md mgt c6 checkpoint 2.2 2024-08-03 04:59:42 -07:00
README.md.backup mgt doc updates 2024-08-01 22:21:07 -07:00
requirements.txt mgt c6 checkpoint 2024-08-03 02:14:20 -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

pip:

pip install flask
pip install python-dotenv
pip install flask-wtf
pip install flask-sqlalchemy
pip install flask-migrate
pip install flask-login
pip install email-validator
pip install pydenticon
...
pip freeze > requirements.txt

db cheat:

flask db migrate -m "users table"
flask db upgrade

flask db downgrade [base]
flask db upgrade

full reset?
rm app.db
rm -r migrations
flask db init
flask db migrate
flask db upgrade

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