Skip to content

How to get started with Dev Containers for local development. We will spin up two containers (one for back-end, PostgreSQL Book DB and a middleware, FastAPI REST API with some Book endpoints). The goal of this project is to help start local development while gaining an understanding on Containers.

Notifications You must be signed in to change notification settings

vguhesan/Python-Middleware-Container

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-Middleware-Container

This code creates a FastAPI Python middleware component with a backend PostgreSQL database spun up as a Docker Desktop container using Dev Containers.

Steps:

  • Checkout the code via git clone {https_repo_url}.
  • Change directory into project. Example: cd Python-Middleware-Container (your directory may vary depending on where you cloned the repository)
  • Ensure that you have Docker Desktop running in the background with "Kubernetes" enabled.
  • Start VSC (with the "Dev Containers" extension enabled.). Example: code .
  • Click on "><" icon bottom left and choose "Reopen in Container".
  • After it opens your Project under "Remote Container", you should see a "Python Middleware Container" group in Docker Desktop.
  • Open a Terminal within VSC and run the following to spin up a "Python FastAPI Middleware Server". uvicorn app:app --reload (refer to https://fastapi.tiangolo.com/ for decumentation on how to start FastAPI example.)
  • Visit "http://127.0.0.1:8000" on your host system browser to see the middleware "default-page" in action.

About

How to get started with Dev Containers for local development. We will spin up two containers (one for back-end, PostgreSQL Book DB and a middleware, FastAPI REST API with some Book endpoints). The goal of this project is to help start local development while gaining an understanding on Containers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages