Skip to content

Application templates

Resource Status
Flask application template Build status
Django application template Build status
FastAPI application template Build status

All application templates come with:

  • TNA Base Docker images with non-root users
  • Docker compose for local development
  • Docker build scripts for GitHub Actions ready to run
  • Environment configuration
  • Poetry for dependency management
  • Tests
  • Development containers for formatting and testing code
  • Formatting configuration
  • Healthcheck endpoints
  • MKDocs

Flask

GitHub repo: flask-application-template

Features

Django

GitHub repo: django-application-template

Features

FastAPI

GitHub repo: fastapi-application-template

Features

  • FastAPI

Using an application template

Setup

  1. Create a new repository from one of the application templates
  2. Update the port in the docker-compose.yml
  3. Create an action variable in GitHub for DOCKER_IMAGE_NAME - this will be the name of the built Docker container

Developing locally

The application templates contain two Docker containers; an app and a dev.

The app container

This is the container for the application.

You can override the base image (IMAGE) and version (IMAGE_TAG) in the docker-compose.yml but by default they use the same non-rooted image as in production. The default values are defined in the Dockerfile.

The dev container

See Included scripts in tna-python-dev.

Possible issues

Using these Docker images in Windows environments could encounter issues with permissions inside the container.

If this occurs, change the IMAGE build argument in your docker-compose.yml to the rooted version of the image.

Do not change the image in the Dockerfile to the rooted version.

Image Rooted image
tna-python tna-python-root
tna-python-django tna-python-django-root