Skip to content

An application about reference letter handling in the context of DIT HUA Thesis 'Usage of devops tools and methodologies in development and productivity of web apps'

Notifications You must be signed in to change notification settings

panagiotis-bellias-it21871/reference-letters-fastapi-server

Repository files navigation

reference-letters-fastapi-server

A back end web application about reference letter handling in the context of DIT HUA Thesis "Use of devops methodologies and tools in development and production environment of web applications"

panagiotis-bellias-it21871

Languages and Tools:

docker git postgresql python

Table Of Contents

  1. Table Of Contents
  2. Run Project Locally (Installation)
    2.1 Clone and initialize project
    2.2 Run application server
  3. Deploy fastapi project to a VM (Virtual Machine)
    3.1. CI/CD tool configuration (Jenkins Server)
    3.2. Deployment with Docker and docker-compose using Ansible

Run Project Locally (Installation)

Clone and initialize project

git clone https://github.com/panagiotis-bellias-it21871/reference-letters-fastapi-server.git
virtualenv fvenv -p python3.X
source fvenv/bin/activate
pip install -r requirements.txt

and

cp ref_letters/.env.example ref_letters/.env

editting .env file to define

DATABASE_URL=sqlite:///./dev.db
ORIGINS = "http://127.0.0.1:8000" # client's ip and port
KC_SERVER_URL="https://auth.some-domain.com/auth"
KC_CLIENT_ID="test-client"
KC_REALM="Test"
KC_CLIENT_SECRET="GzgACcJzhzQ4j8kWhmhazt7WSdxDVUyE"

or

cp ref_letters/.env.docker.example ref_letters/.env
DATABASE_URL=postgresql://<DB-USERNAME>:<DB-PASSWORD>@localhost:5432/<DB-NAME>
ORIGINS = "http://vuejs/" # client's ip and port
KC_SERVER_URL="http://keycloak_auth:8085/auth/"
KC_CLIENT_ID="fastapi-service"
KC_REALM="Clients"
KC_CLIENT_SECRET="GzgACcJzhzQ4j8kWhmhazt7WSdxDVUyE"

in case you want to use postgresql either you are in a docker environment or not. First you should have created a database using pgAdmin or command line. The other variables are referred in keycloak usage where you should suit them according to the environment where keycloak service is running.

Run application server

uvicorn ref_letters.main:app --reload

See what you have done

Deploy fastapi project to a VM (Virtual Machine)

For deployment see here

CI/CD tool configuration (Jenkins Server)

For jenkins configuration see here

Deployment with Docker and docker-compose using Ansible

The fastapi container is built according to the nonroot.Dockerfile as a nonroot process for safety reasons.

More about deployment with Docker see here and here

Docker Images - GitHub Container Registry

# build image
docker build . -t ghcr.io/panagiotis-bellias-it21871/ref-letters-fastapi-server:latest -f nonroot.Dockerfile
# push image
docker push ghcr.io/panagiotis-bellias-it21871/ref-letters-fastapi-server:latest

About

An application about reference letter handling in the context of DIT HUA Thesis 'Usage of devops tools and methodologies in development and productivity of web apps'

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages