Тёмный

Build, Deploy, and Host a Backend From A to Z 

ArjanCodes
Подписаться 249 тыс.
Просмотров 18 тыс.
50% 1

Опубликовано:

 

27 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 61   
@ArjanCodes
@ArjanCodes 3 месяца назад
Check out Hostinger ➡ hostinger.com/arjancodes ✔ Hostinger code for 10% off: ARJANCODES
@AndreaGhensi
@AndreaGhensi 3 месяца назад
Just a few tips for who wants to dig further on Docker and CI: 1. It is better to copy the pyproject.toml and poetry.lock files after installing poetry, since those files can change often and will invalidate the cache of the layers (instructions) after them; 2. Instead of using build args to build the dev or production container, one can use multi stage build to create a dev image with everything installed, and a production image starting from scratch/distroless images and copying over only the bare minimum to run python and the app. 3. You can reverse the deployment logic and use GitOps principle with a service like portainer - you create a docker compose file that you will commit to a repository monitored by portainer, so that when you update the version (it can be done by hand o via automation) it detects the changes and updates the running configuration.
@putnam120
@putnam120 3 месяца назад
Can you point to how to use scratch/distroless with python? Even the distroless page for Python warns about using it.
@Tyzer126
@Tyzer126 3 месяца назад
Do you have an example of multi stage build ?
@TankaNafaka
@TankaNafaka 3 месяца назад
Or use containrrr/watchtower image instead of portainer.
@TankaNafaka
@TankaNafaka 3 месяца назад
​@@putnam120there are good examples on distroless gh repo
@AndreaGhensi
@AndreaGhensi 3 месяца назад
@@Tyzer126 It seems that I cannot post links, I already answered to @putnam120 but I can't see my post. search for "chainguard wolfi python" in google, choose the "Image Overview: python" page and look at the "Usage" section
@CRutgerX
@CRutgerX 3 месяца назад
Great base to start. At the end consider giving a list of short examples that are out of scope for the video that people can continue in. Theres a lot more topics that people can learn to get the deployment production ready. Docker swarm, k8, revproxy for multiple services, letsencrypt, hosting templating tools like nginx-ui, load balancers for uptime, deeper testing methods, etc. This topic is endlessly large and many people dont know where to begin searching.
@YossiZinger
@YossiZinger 3 месяца назад
It's also important to talk about versioning - maybe for a single personal website it's not that important. When working in a multi-server environment (e.g. dev/test/prod) it's critical, and also when deploying into multiple servers (e.g. k8s cluster, especially when using blue green deployment or similar)
@alexiicarey
@alexiicarey 3 месяца назад
Great overview. I would love to see how you setup SSL certificates and the dns on the web server to map request to a domain name.
@MaxShapira2real
@MaxShapira2real 3 месяца назад
That's super helpful. Could you add the CI/CD pipeline YAML files? I don't see them in the repo. Thanks Arjan! You've been crushing it lately.
@bbowling4979
@bbowling4979 3 месяца назад
Thank you Arjun for making this video. It's very interesting to see people's approaches to the software management and deploy cycle.
@jake115577
@jake115577 3 месяца назад
You have the best code examples, Arjan. Thank you 🙏
@ArjanCodes
@ArjanCodes 3 месяца назад
Glad you like the content, Jake!
@M_7844
@M_7844 3 месяца назад
I would appreciate a video about imports. Struggling to make two files in siblings folders see each other was not a pleasant surprise from Python.
@Golgafrincham
@Golgafrincham 3 месяца назад
Great guide! It would be awesome with a video covering setting up SSL!
@TankaNafaka
@TankaNafaka 3 месяца назад
nginxproxy/acme-companion or use Caddy
@_rozto
@_rozto 3 месяца назад
2:34 For the docker I usually don't install poetry itself as it adds up to the size, i create separate docker-requirements file which i use to install all the dependencies. I also use a slim version of python for the same reason.
@ArjanCodes
@ArjanCodes 3 месяца назад
Thanks for sharing!
@jim-i-am
@jim-i-am 3 месяца назад
@ArjanCodes Docker is great. Extra work is usually required, however, to run the image on different CPU architectures. Maybe a short video about the challenges/solutions for multi-architecture development and deployment is helpful since Arm is an increasingly targeted? (M1+, Graviton, Pi, etc.). (i.e. Arm is now the preferred arch for most of our workloads on AWS). (Note: Fun projects I've done is to deploy simple services like you demonstrate on Raspberry Pi or an old repurposed Android phone. They are surprisingly capable and the latter has a UPS!) Thanks for the great content...you're the gold standard for easy to understand design pattern learning.
@404S1mon
@404S1mon 3 месяца назад
Nice video! However, containerization doesn't really automatically solve architecture compatibility issues. For example, if you build a container image with a compiled Rust application on an x86 system, it won't run on an ARM system. What you can do is using Docker Buildx and configure it to build images for multiple architectures.
@ArjanCodes
@ArjanCodes 3 месяца назад
Good point!
@roaldkleiveland
@roaldkleiveland 3 месяца назад
The owner of the company I work for is said to be conservative and old-school - he wants to have as much as possible of what I develop hosted on-prem, so that's what I give him. Maybe he's more modern than I thought :)
@Pirake123
@Pirake123 3 месяца назад
Thanks Arjan, would be cool if you extended this to run some unit tests or integration tests. thanks again
@witcherek
@witcherek 3 месяца назад
will be nice to make a video about https certificates, secure etc.
@spencerpark1459
@spencerpark1459 3 месяца назад
Would love to see the https set up!
@hipertracker
@hipertracker 3 месяца назад
You can easily automate setting up all soft on the server with Ansible.
@TankaNafaka
@TankaNafaka 3 месяца назад
8:10 ehm scaling, the magic word that pops up each time as a problem description for a modern software engineering.😂 My answer to this: unless you are doing heavy datamining, etc, make sure your app works on a single VM, use any caching, proxy,patterns if needed. ymmv 🇩🇰
@Djellowman
@Djellowman 3 месяца назад
Would database changes be persistent? Seems like the database contents are lost when the docker container stops.
@saminyead1233
@saminyead1233 3 месяца назад
You have to attach a volume to it. Then the data will persist even if you stop the container.
@Djellowman
@Djellowman 3 месяца назад
@@saminyead1233 Yeah, a shared volume, but I didn't see that in the dockerfile.
@ArjanCodes
@ArjanCodes 3 месяца назад
Indeed, a persistent volume will work. Personally I prefer using a separate, hosted database service. That will have things like backups, sharding, access control etc built in, which is nice.
@diegol_116
@diegol_116 3 месяца назад
tip: don't do this on your own, use the solutions that cloud providers provide for this. You will save yourself a lot of headaches.
@ArjanCodes
@ArjanCodes 3 месяца назад
@diegol_116: exactly this!
@aliriano15
@aliriano15 3 месяца назад
ArjanGOAT
@SeanChitwood
@SeanChitwood 3 месяца назад
So, one little quibble about Docker. Since linux can be on multiple architectures, you can't necessarily run your docker image on all Linux boxes. If you build on an image that only supports x86, you're limited to x86, etc. This can be a problem if you're on a newer mac and your hosting service is running on x86, ending up with a "Works on my machine, but not in CI!" situation. So, one "gotcha" to be aware of.
@juanvelazquez3306
@juanvelazquez3306 3 месяца назад
thank you Arjan, such a good video, I'll like to see how to integrate with *https*, always in tune with your channel!!
@richardnpaul_mob
@richardnpaul_mob 3 месяца назад
Zee, Zed the last letter of the alphabet 🤣 the latter is a very good choice 😂
@hubstrangers3450
@hubstrangers3450 3 месяца назад
Thank you....
@ArjanCodes
@ArjanCodes 3 месяца назад
You’re welcome!
@johncrunk8038
@johncrunk8038 3 месяца назад
docker? Barf!
@EusebioResende
@EusebioResende 3 месяца назад
Great video as always Arjan. May I suggest a video on the topic of handling secrets. For example In this video you needed a SSH_PRIVATE_KEY in order to connect to the VPS. It would be great to have your insight on we should handle such secrets. Thanks for sharing.
@JPy90
@JPy90 3 месяца назад
This kind of content is mostly appreciated
@ArjanCodes
@ArjanCodes 3 месяца назад
Glad you enjoyed it!
@christianjohnson3497
@christianjohnson3497 3 месяца назад
I would be interested in a video on how you setup the certificate/https side of things
@Tyzer126
@Tyzer126 3 месяца назад
Very interested in a video about port forwarding, networking, certificates, this kind of things :D
@sambroderick5156
@sambroderick5156 3 месяца назад
Please cover setting up SSL.
@richard17lucas
@richard17lucas 3 месяца назад
Thank you - very useful video (and well made, nice touches like the occasional zoom shift). +1 for https certs explanation.
@ArjanCodes
@ArjanCodes 3 месяца назад
Glad you enjoyed it!
@UNgineering
@UNgineering 3 месяца назад
Would using VPS still have the same scaling issues? Or do they have some auto-scaling option that automatically increases your cpu/network/ssd/ram and scales them down as your application needs them?
@Lexaire
@Lexaire 3 месяца назад
Great guide until you started deploying it on a VPS. So much wrong with this method. What happens when your VPS needs package updates? Or when the container goes down? Or the server goes down? This method you've outlined is only useful for a hobbyist that doesn't care about uptime.
@CRutgerX
@CRutgerX 3 месяца назад
Nothing wrong with this method, just incomplete. Im assuming you prefer baas or lambdas, but arjans method can scale horizontally just fine. Setting up a docker swarm or k8 on 2 or 3 seperate vps is more then solid enough. Honestly is rather worry about the incomplete web deployment where he doesnt go into detail about protecting the endpoints with a load balancer or even just a reverse proxy with nginx or something similar. Especially if you start hosting multiple services.
@zikomo8913
@zikomo8913 3 месяца назад
​@@CRutgerXWhere do I study all this man? I can build Rest Api in flask lol, but all this system design kind of stuff. I want to learn it all at one place and implement it
@viralmehta6136
@viralmehta6136 2 месяца назад
@zikomo, read the book - Designing Data Intensive Applications to learn more
@ramimashalfontenla1312
@ramimashalfontenla1312 3 месяца назад
Really useful video!
@ArjanCodes
@ArjanCodes 3 месяца назад
Glad it was helpful!
Далее
Protocols vs ABCs in Python - When to Use Which One?
15:31
PostgreSQL, MySQL, and MongoDB are Boring
23:55
Просмотров 13 тыс.
18 Weird and Wonderful ways I use Docker
26:18
Просмотров 162 тыс.
Every Developer Should Know This
15:38
Просмотров 27 тыс.
$40 Moxon Vise - Easy to build in an afternoon!
15:06
Просмотров 968 тыс.
My FAVORITE Error Handling Technique
16:01
Просмотров 37 тыс.
Brutally honest advice for new .NET Web Developers
7:19
Everything You NEED to Know About WEB APP Architecture
10:27
Quick and Easy Rate Limiting for FastAPI
18:15
Просмотров 13 тыс.
Your own Vercel on VPS - Coolify
14:07
Просмотров 7 тыс.