inFocus7 / TrendGenie

Your content creation assistant.
GNU General Public License v3.0
2 stars 0 forks source link

Docker-ize Application #18

Closed inFocus7 closed 10 months ago

inFocus7 commented 11 months ago

We should add a Dockerfile (and requirements.txt) to allow for simpler setups, where a user can just bring it up without needing to install extra dependencies.

inFocus7 commented 11 months ago

Thinking out loud... Docker-izing shouldn't be too bad.. not sure how Python docker apps are usually handled, but for Go it's a simple enough process:

  1. Copy files
  2. Build app
  3. Only keep executable binary(?) to lessen image size
  4. Run binary(?)

As I haven't used Python much, I'm unsure if steps 2-3 are similar, but a quick (maybe naive) way of handling would be to just copy the files onto the image, installing dependencies, and python3 main.py. Would need to check that the Gradio app port (7860) is exposed in container.

Note, this would require creating a requirements.txt file (like a go mod file) so that we can install all necessary dependencies.

Edit: A couple questions would be, would downloading/saving to disk still work as expected? The code just does something like a os.save('/images/etc...), and I'm unsure if that means it would just save inside the docker container...