How to Dockerize FastAPI | Complete MVP | Python + HTML & JavaScript

Published: 11 August 2022
on channel: jobstr
433
7

How to use"Supervisor" along with Apache and Uvicorn for 1 self contained image. This is an "MVP" at this stage but it works 100% and Authentication would be the next task. Rather than use Flask, whatI have done here is create a Docker image with FastAPI and a HMTL/JavaScript front end that will run in a Single container.

Note: this if for MVP / Demo purposes, in production you would use separate containers and a Docker network: https://docs.docker.com/network/bridge/

aka : How to expose 2 ports in docker : Apache (html & js), Uvicorn (FastAPI)

📍 Check out these amazing FastAPI courses 📍
🔗 https://testdriven.io/courses/tdd-fas...
🔗 https://testdriven.io/courses/scalabl...
🔗 https://testdriven.io/courses/fastapi...

--------------------------------------------------------------------------------------------------------------------------
👍 If you would like to, maybe become a patron on Patreon? 👍
🌏   / drpi  
--------------------------------------------------------------------------------------------------------------------------

-- chapters --
00:00 intro
03:05 supervisor (how to run 2 services)
06:07 Travis "How to deploy FastAPI with Nginx and Supervisor"
10:20 The front end running inside the Docker image
15:10 view logs - Docker from vscode
17:48 project summary
------------------------------------------

FastAPI playlist :    • FastAPI full projects (Docker, HTML, JavaS...  
FastAPI + Docker ~ Series playlist :    • FastAPI + Docker  

Download the docker image and try it out for yourself!
$docker pull redandgreen/subnet-api:1
Full Project available here : 🌏 https://github.com/RGGH/ip_checker

Useful links:
-----------------------------------------------------------------------------------------------
https://levelup.gitconnected.com/crea...
https://techexpert.tips/docker/docker...
https://docs.docker.com/config/contai...
https://linuxhint.com/how-to-create-a...
https://phoenixnap.com/kb/how-to-comm...
----------------------------------------------------------------------------------------------

🌏 https://github.com/RGGH/ip_checker/bl... for the supervisor config

🌏 10% off ScraperAPI : https://www.scraperapi.com?fpr=ken49
◼️ Coupon Code: DRPI10
(You can also get started with 5000 free API calls. No credit card required.)

👍 Become a patron 👍
🌏   / drpi  

Buy Dr Pi a coffee (or Tea)
☕ https://www.buymeacoffee.com/DrPi

🔵 Proxies 🔵
=================================================
If you need a good, easy to use proxy, I was recommended this one, and having used ScraperAPI for a while I can vouch for them. If you were going to sign up anyway, then maybe you would be kind enough to use the link and the coupon code below?

You can also do a full working trial first as well, (unlike some other companies). The trial doesn't ask for any payment details either so all good! 👍

🌏 10% off ScraperAPI : https://www.scraperapi.com?fpr=ken49
◼️ Coupon Code: DRPI10

https://linuxhint.com/how-to-create-a...

Thumbs up yeah? (cos Algos..)

#docker #fastapi #pythontutorial


On this page of the site you can watch the video online How to Dockerize FastAPI | Complete MVP | Python + HTML & JavaScript with a duration of hours minute second in good quality, which was uploaded by the user jobstr 11 August 2022, share the link with friends and acquaintances, this video has already been watched 433 times on youtube and it was liked by 7 viewers. Enjoy your viewing!