Owez/yark

Docker support

Closed this issue · 7 comments

I've got a PR ready to add docker support.

Is it OK to add github actions for building the image, I'll also need to add a command line option to allow changing the bind address for view so it can be bound to 0.0.0.0 for the container.

If's that's all good I'll go ahead and put in the PR.

Owez commented

Yep, github actions are totally fine to use, I was going to use it for linting/formatting soon. Can you add a --port= option with that new --host= option for the viewer so it configuring it is a bit more feature complete? Once that's good i'll review and merge

What about using argparser for the flags and arguments ?

Owez commented

What about using argparser for the flags and arguments ?

The homegrown one has a bit of life left in it, if it ain't broke don't fix it (for now). Eventually it should be replaced with something nice like click or the other popular one

I've had a quick go but there's some bugs in the archiver-debt branch that I'll wait to get settled.

But basically the changes I was looking to make:

  • add bind_host, bind_port and open_in_webbrowser properties to Config.
  • add settings_flask method to Config.
  • add argument parsing to view command.
  • add a Dockerfile.

And so I don't lose it, the help text for view.

yark view [name] [args?]

  Launches offline archive viewer website, optionally opening a webbrowser
  to view a specific archive.

Arguments:
  --disable-webbrowser  Disabled the automatic opening of a web browser
  --host=[host/ip]      Bind to specific IP or hostname
  --port=[port number]  Bind to a different port number than the default 7667

 Example:
  $ yark view
  $ yark view demo
  $ yark view demo --disable-webbrowser --host=0.0.0.0 --port=8080
Owez commented

Them changes look good, if you take the branch as it is now at 0ee9be0 it should be stable enough to add. Made a design descision yesterday to opt for Python 3.11-only (#93) so you might have to update the image to it

Owez commented

I'll leave this open even though #106 has been merged because the restructure with the new GUI has made it so docker is needed for yark-api specifically and not the current all-in-one dockerfile on the master branch at the moment