Better docker deployment strategy
This is the PR submitted for #167. I've done some testing and made as small changes as possible to accomplish this feature.
Initially, I used Debian Bookworm for the build and run environments, but some strange errors occurred when running on older systems. Then, I started to explore building and running it under Alpine, with surprisingly good results: Its final image artifact is now only 20MB! I think that's cool! 🎉
There doesn't seem to be any issue with functionality from my basic testing since the current features aren't too numerous. I've pushed a latest image to Docker Hub, you might want to give it a try:
docker run -d -p 8000:8000 --name screenshot-to-code wearzdk/screenshot-to-code:latest
To build it locally, run:
docker buildx build -t username/screenshot-to-code .
To push to Docker Hub (need to log in):
docker push username/screenshot-to-code:latest
You could attempt to build and push it to Docker Hub, then supplement the readme as a deployment solution.
Apply Sweep Rules to your PR?
- [ ] Apply: All new business logic should have corresponding unit tests.
- [ ] Apply: Refactor large functions to be more modular.
- [ ] Apply: Add docstrings to all functions and file headers.
I installed it in Docker and it worked. So easy to deploy it. Thanks.
thanks pal, it works great!
Thanks for the PR. I'm going to stick with the current Dockerfile for now. I'm not a Docker expert and I'm too busy at the moment to maintain something more complicated that I understand less well.
Appreciate the PR though, and if the current Docker set up is not working for people, I encourage them to check out your repo.