Skip to content

A Flask app for creating VAT invoices, using Docker, CI/CD, Google Cloud Run

License

Notifications You must be signed in to change notification settings

e-mit/vat-invoice

Repository files navigation

VAT invoice generator

docker test build tests coverage flake8 mypy pycodestyle pydocstyle pylint pyright bandit docker release build release test docker-hub-push google-cloud-deploy

A Python web application for creating VAT invoices.

This project uses Flask, WTForms and Docker. PDFs are generated with Weasyprint.

Try the example deployment on Google Cloud Run. (Note: this is a free GCR instance which scales to zero, causing a brief startup delay).

It is also hosted on AWS EC2 at https://vat.e-mit.dev.

Docker Hub image repository

Readme Contents

Development and testing

The Dockerfile has two targets: test and release. The release target excludes test files/packages.

Tests and linting checks run via GitHub actions, in the test container, after each push.

During local development:

  • Run all tests with build_and_test.sh
  • Try the release version at 127.0.0.1:8080 with release_run.sh

Continuous deployment

If all GitHub action test/lint workflows pass, and if the commit was tagged with a version, the new release image is automatically pushed to Docker Hub and deployed to Google Cloud Run as a new revision.

The release image on Docker Hub is tagged with the commit hash. The app's /version HTTP route serves a json string giving the version tag and the commit hash.

License

See the LICENSE file for software license rights and limitations (AGPL-3.0).