Skip to content
/ fastapi-mongo Public template

Fast API Microservice for API development

Notifications You must be signed in to change notification settings

akmamun/fastapi-mongo

Repository files navigation

FastAPI Micro Service with Docker, Nginx, and Asynchronous MongoDB (Motor)

Installation Instructions

  • Create a virtual environment
  • Install the Python dependencies with
    pip install -r requirements.txt
  • Copy the .env.example file as .env
    cp .env.example .env
  • Ensure that you fill in all the valid environment properties in the .env file.

Run Locally

  • To run the service locally, use the following command:
    uvicorn server:app --reload

Run with Docker

  • To run the service using Docker, use the following command:
      sudo docker-compose up -d --build

Run Docker Compose for Production Build