How to Dockerize FastAPI | Complete MVP | Python + HTML & JavaScript
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-fastapi/?utm_source=python360
? https://testdriven.io/courses/scalable-fastapi-aws/?utm_source=python360
? https://testdriven.io/courses/fastapi-celery/?utm_source=python360
--------------------------------------------------------------------------------------------------------------------------
? If you would like to, maybe become a patron on Patreon? ?
? https://www.patreon.com/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 : https://youtube.com/playlist?list=PLKMY3XNPiQ7uJpJ_PmfbnURiXpqL4umPM
FastAPI + Docker ~ Series playlist : https://youtube.com/playlist?list=PLKMY3XNPiQ7sBx6l6RyfGO3PvIO3sDv7y
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/creating-an-api-with-fastapi-and-docker-809429d778e6
https://techexpert.tips/docker/docker-container-running-multiple-services/
https://docs.docker.com/config/containers/multi-service_container/
https://linuxhint.com/how-to-create-a-docker-image/
https://phoenixnap.com/kb/how-to-commit-changes-to-docker-image
----------------------------------------------------------------------------------------------
? https://github.com/RGGH/ip_checker/blob/main/misc/supervisord 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 ?
? https://www.patreon.com/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-docker-image/
Thumbs up yeah? (cos Algos..)
#docker #fastapi #pythontutorial
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «How to Dockerize FastAPI | Complete MVP | Python + HTML & JavaScript», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.