Skip to content

ntnrmr/flask-example

Repository files navigation

Flask SQLalchemy app

Example Flask application which stores data in PostgreSQL database

Initial setup

Install dependencies and develop locally

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt

Run application locally with docker-compose

pip install docker-compose
docker-compose up --build

Run pre commit hooks

pip install pre-commit
pre-commit install
pre-commit run --all-files

Deploy GCP infrastructure

flowchart LR
    A[Client] -->|http| B(Cloud Run) -->|socket| C[Cloud SQL]
Loading

Create base infrastructure. Be sure to update backend.tf to setup remote backend

cd deploy/
terraform init
terraform plan
terraform apply

Build and deploy application

Build and update image in Cloud Run using BlueGreen deploy technique

gcloud init
./deploy.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published