mgt doc updates

This commit is contained in:
finn 2024-08-01 22:21:07 -07:00
parent 52c1e056c1
commit a8068c8578
3 changed files with 66 additions and 5 deletions

View File

@ -6,6 +6,7 @@ COPY requirements.txt /code
RUN target=/root/.cache/pip \ RUN target=/root/.cache/pip \
pip3 install -r requirements.txt pip3 install -r requirements.txt
# Need to make this explicit as part of expansion, no migrations or venv
COPY . . COPY . .
ENV FLASK_APP app.py ENV FLASK_APP app.py

View File

@ -1,7 +1,13 @@
## Workflow:
pip: - 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 flask
pip install python-dotenv pip install python-dotenv
@ -10,12 +16,11 @@ pip install flask-sqlalchemy
pip install flask-migrate pip install flask-migrate
pip install flask-login pip install flask-login
pip install email-validator pip install email-validator
...
pip freeze > requirements.txt pip freeze > requirements.txt
``` ```
db: ## db cheat:
``` ```
flask db migrate -m "users table" flask db migrate -m "users table"
flask db upgrade flask db upgrade
@ -23,4 +28,17 @@ flask db upgrade
flask db downgrade [base] flask db downgrade [base]
flask db upgrade 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

42
backend/README.md.backup Normal file
View File

@ -0,0 +1,42 @@
## Workflow:
- should work with flask run and dockerfile build
- local dev
- local pip install
- record versionless pips manually here
- pip freeze snapshots into project requirements
- docker build 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 freeze > requirements.txt
```
## db cheat:
```
flask db migrate -m "users table"
flask db upgrade
flask db downgrade [base]
flask db upgrade
```
## build:
Dockerfile needs explicitly defined copies for:
- app
- config
- project dir
- requirements
## notes:
- environment comes through project env passes through compose
- keep env untracked but templated
- no dotenv here, dotflaskenv goes into image