Skip to content

GitHub Actions Pipeline with a FastAPI Application built, tested and deployed to DockerHub.

License

Notifications You must be signed in to change notification settings

san99tiago/fastapi-docker-github-actions

Repository files navigation

FASTAPI-DOCKER-GITHUB-ACTIONS

example workflow


Overview 🔮

Welcome to the FastAPI-Docker-GitHub-Actions Lab! This repository serves as an educational example of a CI/CD project that demonstrates the usage of GitHub Actions for deploying a simple FastAPI server. Key components include:

Usage 👻

The core idea is to have a CI/CD pipeline that illustrates the automation with Continuous Integration, however, you can follow these steps to configure/run the project locally:

Clone the repository

Begin by cloning this repository to your local machine:

git clone https://github.com/san99tiago/fastapi-docker-github-actions
cd fastapi-docker-github-actions

Configure Python Dependencies with Poetry

To manage Python dependencies and create a virtual environment, install Poetry following the instructions for your preferred installation method:

Once Poetry is installed, execute the following commands for its setup:

poetry shell
poetry install

Run the Server Locally with Uvicorn

To run the FastAPI server with Uvicorn, use the following command:

poe fastapi-local

Run the Server Locally with Docker-Compose

For an easy way to run the FastAPI server as a Docker container using Docker-Compose, use the following commands:

# Start the service
poe fastapi-docker-up

# Stop the service
poe fastapi-docker-down

Validate the Server

After running the server using the previous commands, open your preferred tool for making API requests and try the following REST-API endpoints:

Special thanks

A big thank you to all the dedicated contributors who have made the open-source projects used in this repository possible.

Author 🎹

Santiago Garcia Arango

This repository's content is inspired by multiple online resources. Please feel free to use it as a guide for your future projects.!

As a Curious DevOps Engineer, I am deeply passionate about implementing cutting-edge cloud-based solutions on AWS.
I firmly believe that today's greatest challenges must be solved by the expertise of individuals who are truly passionate about their work.

LICENSE

Copyright 2023 Santiago Garcia Arango