GrammaticalFramework/gf-core

GF on Docker?

kristiank opened this issue · 2 comments

A quick search on the internet for Grammatical Framework and Docker finds many hints for at least some support of GF having been dockerized.

Looking at it as a newcomer from the outside, it would be much worth having information about Docker under the Get started > Download GF heading.

What I would expect is some Docker commands for getting gf --server running in a container instance and some notes on which version of GF it contains and whether the version will always be the latest when running the Docker commands again.

Yes this makes sense, to be honest I thought there already was a Dockerfile in gf-core but apparently not.

Compiling and running GF in a Docker container is straightforward enough, but we need to think about how to get grammars into this container.

  • There's the RGL, which would need to be compiled inside the container too, but is not part of the gf-core repository. So maybe we have a start-docker.sh script, which if provided a path to RGL sources, compiles them as part of the image build. If not provided, either pulls the latest from GitHub and uses those, or just doesn't compile any RGL.
  • Then there's the user's own grammars. I'm not really sure what the use-case is here. If they are new users then presumably they don't have any grammars or are in the process of writing some. Rather than try to accommodate this, I think we have to leave this up to the user as to how to get their grammars into the container, e.g. via mounting a volume etc.
  • To complicate this a little, there's also Krasimir's new effort to move the GF cloud stuff into a separate repo. I guess here we handle it in the same way as the RGL, i.e. the start-docker.sh script does slightly different things depending on whether it is given a path to gf-cloud or not.

It might be possible to resolve this by doing the dockerfile in several layers, where e.g. the rgl dockerfile depends on the gf-core one. One downside is that it might be confusing to have a gf docker image that doesn't include rgl. But maybe naming it gf-core and naming the one with rgl just gf is enough to resolve that confusion.

When it comes to user grammars, the user could in turn have their own dockerfile or docker-compose config that imports their grammars into the image or mounting it. We could provide a template for doing that, to make it easier.

Using layers would also resolve the GF cloud issue, by having a separate docker-file for that as well, that depends on the gf-core docker file, in which case that docker image would also be imported by the one just called gf.