Flask app uses the following python libs:
flask_cors
sqlalchemy
marshmallow
psycopg2
graphene
graphene-sqlalchemy
-
Install:
sudo apt install postgresql postgresql-contrib
-
Instanciate postgres user
sudo -u postgres -i
-
Create app user & buitre database
CREATE USER app WITH PASSWORD '1234';
CREATE DATABASE buitre OWNER app;
-
Run Alembic Migrations
alembic upgrade 47ef3050097f #initial migration
@TODO: find a way to "upgrade to the whole migrations collection"
using virtualenv
: this will install the dependencies
virtualenv venv
source venv/bin/activate
Then run flask
export FLASK_APP=buitre.py
flask run
browse 127.0.0.1:5000
using pipenv
: this will install the dependencies
install dependencies:
Then run bootstrap
./bootstrap.sh
browse 127.0.0.1:8000
Run single flask app container (no DB)
-
Build the image
docker build -t buitre_img .
-
Check image is created
docker images
-
Run the container
docker run -d -p 80:80 --name buitre_ctn buitre_image
-
Check container is running
docker ps -a