Skip to content

tsadimas/fastapi-starter-project

Repository files navigation

Run project locally with docker-compose

  • copy .env.example to .env
cp app/.env.example app/.env

run with docker-compose

docker-compose -d --build

Links

Pre commit Hooks

pip install pre-commit

create a sample pre-commits file

pre-commit sample-config > .pre-commit-config.yaml

edit this file to add hooks install hooks

pre-commit install --install-hooks

Container registry

docker registry

Github Packages

  • create personal access token (settings --> Developer settings -- > Personal Access Tokens), select classic
  • select write:packages
  • save the token to a file
  • to see packages, go to your github profile and select tab Packages
  • tag an image
docker build -t ghcr.io/tsadimas/pms8-fastapi:latest -f fastapi.Dockerfile .
  • login to docker registry
cat ~/github-image-repo.txt | docker login ghcr.io -u tsadimas --password-stdin
  • push image
docker push ghcr.io/tsadimas/pms8-fastapi:latest

Useful

truncate table artist restart identity cascade;

create docker login secret

  • create a .dockerconfigjson file, like this
{
    "auths": {
        "https://ghcr.io":{
            "username":"REGISTRY_USERNAME",
            "password":"REGISTRY_TOKEN",
            "email":"REGISTRY_EMAIL",
            "auth":"BASE_64_BASIC_AUTH_CREDENTIALS"
    	}
    }
}
  • create <BASE_64_BASIC_AUTH_CREDENTIALS> from the command
echo -n <USER>:<TOKEN> | base64
  • create kubernetes secret
apiVersion: v1
kind: Secret
metadata:
  name: registry-credentials
  namespace: default
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: BASE_64_ENCODED_DOCKER_FILE

where BASE_64_ENCODED_DOCKER_FILE is

cat .dockerconfigjson | base64 -w 0

Links

Tests

run

tavern-ci tests

or

docker-compose exec fastapi tavern-ci tests

Links

truncate artist restart identity cascade;

About

A fastapi/postgres/keycloak/vuejs starter project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published