is learning docker worth it for hobby Python development?
Setup a Python environment with Docker
Docker for Pythonistas
There are already created official docker images for all major python versions:
-
https://registry.hub.docker.com/_/python/
There are also very usefull 'onbuild' versions.
More on reddit.comHow do you use python dependencies in a docker image?
Videos
» pip install docker
I've got a low frequency (6 pages per min limit) scraping script running on my pc more or less 24/7 to send me some push notifications. Now that I got the process proof of concept working with duct tape and sheer will, I've been slowly rebuilding it in parallel with better practices ex: it's just a loop with functions, no classes, testing, error catching or logging, I'm using selenium for everything but I'm moving to a mixture of selenium to load and click but faster selectorlib and easily updatelable yaml files to read the fully loaded HTML from selenium, etc, etc.
I dusted off my raspberry pi 4 and thought I could probably run a MySQL server for the data instead of a local SQLite database and maybe learn fastapi at the same time. In the past I just used the firewall to restrict to lan and had sqlalchemy connect directly to MySQL but fastapi seems like its worth learning and this seems like a good project to use it on.
I don't know what got me down the docker path but I've been researching it for about 2 weeks now to see if running a fastapi + MySQL dockers would make sense. after 2 weeks I can run containers and know the very basics of the dockerfile I still don't really understand what a development workflow in docker and vscode would look like as a single hooby dev. I'm starting to think maybe I should just run fastapi just with venv on uvicorn and MySQL without docker on the pi. Since I'm only accessing the server on lan, I'm not deploying on multiple devices or working as a team it's hard to see if knowing this extra layer is worth it. I might move the script itself over to the pi, I might make a simple crud web interface as well so maybe at that point docker will be helpful or will venv always suffice?