Installation

Docker container for production environment?

Docker container for production environment?

by Alasdair McAndrew -
Number of replies: 1
I am slowly moving all my web apps into docker containers, for ease of maintenance and for modularity. In following the instructions at https://github.com/openwebwork/webwork2/wiki/Docker-newbie-instructions the docker container seems to pull in a complete Ubuntu installation, which looks like overkill - my VPS is already running on Ubuntu.

What I want to know are:
  1. Is there a smaller dockerized version of WeBWorK (say based on Alpine instead of Ubuntu)?
  2. Is this version suitable for a production environment - to be used by my students as well as me and my colleagues?
  3. How do I move my current WeBWorK course files into the container?
I'm also wondering, for simplicity and cutting down on size, whether it would be possible to use MathJax instead of a full LaTeX environment?

Finally, given that I already run WeBWorK (but served up by apache) how easy it would be to build a docker container myself, and simply using all the files already in /opt/webwork/webwork2.

Thanks very much!


Note: the docker container failed to build. I got a message:

ERROR: Service 'app' failed to build. The command '/bin/sh -c ...<very long command> ...&& rm /tmp/VERSION' returned a non-zero code: 22
In reply to Alasdair McAndrew

Re: Docker container for production environment?

by Michael Gage -
Hi Alasdair,

As to the last point about the error.
Try merging pull request #882 (from taniwallach)
into your copy of webwork2

Then rebuild the software inside the docker again.
You might have to delete stale images to make sure that
docker rebuilds from scratch.

1. At the moment there isn't another version of the docker environment using alternative operating systems but I encourage people to develop something like this.
2. I wouldn't use the docker version of this in production just yet -- we are still refining it. In the long run yes -- Pan Luo (@xcompass) says that they are planning to run WeBWorK at UBC from a docker environment. You can check with @xcompass if you want to find the lastest news on using docker and webwork in production.

3. Your courses are in a file webwork2/.data/courses and can be accessed from "outside" the docker environment. The course files don't include the database information however.
You need to archive your course on it's current server, transfer the archived .tar.gz file to webwork2/.data/courses, then start up the container (docker-compose up) and from the admin page for the site unarchive the course which you have placed in webwork2/.data/courses