orangeforum
orangeforum copied to clipboard
Docker support
It would be awesome, if I could install orangeforum by using Docker.
Orangeforum is available as a single binary for Linux. Is docker really needed when there are no dependencies?
In any case, a PR is welcome!
I'll try to create a docker image ;)
I have a working Dockerfile for Orangeforum, but one issue is the creds. Ideally, one would want to start the Docker container with the -d option to run it in the background, but Orangeforum creates it's administrative user with the -createsuperuser flag that only takes interactive input (I suspect to keep secrets from leaking into the bash history or places like that?). That means in order to create the superuser, you have to run the container interactively and enter the username/password combination when it starts. That's inconvenient, IMO, and makes it harder to get some of the beneficial things that could come with having a Docker image.
If it were possible to pass a username/password combination as arguments to -createsuperuser(As is the case in -createuser already), then the superuser could be built in the image by passing --build-args. That way the username/password pair wouldn't be available to the running container, but the superuser could be configured automatically.
Passing the password in plain text doesn't seem like a good idea. I wonder how this is handled for other Django apps where the admin user is created interactively.
Is it really necessary to create the super user in the same docker container? It's a one-time thing that could be done outside the container after the database has been setup. orangeforum is a single binary with no dependencies.
I think if we do a volume separately(as in a data-only container), and interactively set up the superuser in the data container, then we can detatch with -d as normal. I'm not aware of a django app that does it this way(I spend almost no time in Python), but I think hangups(the reverse-engineered Google hangouts client) does it this way, just with the goal of maintaining login session and not for the purposes of detatching neatly. I think that might be the 'right' way to do it.
I've got it figured out. I guess the last thing I'd have to ask you is do you want to put it on dockerhub or do you want to instruct people how to build it locally?
Perhaps both? Push major new releases to dockerhub and have instructions to build the latest version locally.
Oh maybe I submitted that pull request just a bit early then. My bad. I made a little tweak to the instructions in the readme, working from the assumption that it'll be on your Dockerhub account. Alternatively, I'd keep my fork current and you could use my Dockerhub account. Otherwise, the existing instructions are OK, except apparently I put in a typo by accident, 127.0.0.0 should be 127.0.0.1 in the docker run -p line.