Skip to content

Add ability to build this using docker

David Corne requested to merge davidcorne/pathfinder-2-sqlite:docker into master

Background

Not related to this merge request, but I'm planning on taking a look at the monsters.yaml conversion as I'm interested in building a tool to easily list summons. For me, this will be easier if I have a repeatable development environment without having to change python versions or install extra modules.

Problem

I want to be able to run this tool without installing the prerequisites.

Solution

Adding a Dockerfile with the correct dependencies was pretty straightforward (thanks for the excellent readme!). The tricky part was then getting it to run on that system. There were a few changes required in gendb.py and I've added instructions on how to use this to the README.

Changes to gendb.py

  • The paths needed to be converted to strings as otherwise they were throwing exceptions saying that you can't convert POSIX path classes to strings in the os.* functions.
  • I was having an issue with a UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 305: ordinal not in range(128) error. But this was fixed by the explicit encoding change.

README instructions

These show you the correct commands to run this using docker, and get the database out of that container. Hopefully these fit in with the rest of the document and are easy to follow. I'm very happy for these to be relocated or reworded.

Verification

I've run this using docker and my instructions on my home and work computers and it works reliably.

Future Thoughts

This could be built upon to set up CI/CD for this repo. A free system could at least check that changes won't break running gendb, and potentially create a downloadable database if that's desirable.

Changes or Suggestions

I'm very open to any suggestions or changes to this, please let me know. Especially where I've changed the documentation.

Edited by David Corne

Merge request reports