OJS + NGINX w/ Lets Encrypt SSL + Docker


I needed a containerized setup for my OJS instances and build up a docker setup for this.

You can find all you need on GitHub

Hope it helps some of you. :slight_smile:



Our community is working with Docker too, including some recent work! Heads-up @marc.

Alec Smecher
Public Knowledge Project Team

Yep I saw @marc docker project. Looks awesome :+1: Unfortunately it uses Apache which I can’t use due to various non ojs related reasons. Main goal of my prototype was to ease up the whole NGINX setup including SSL.

I will definitely extend the build to include a variable ojs version and the automatic installation of ojs Like marc did.

Will keep you updated right here. :slight_smile:


My docker project was abandoned some time ago [1] to join @lucasdiedrich work that last month grown to be a an official PKP project (with @Dulip_Withanage and David from Erudit -anybody knows his username in the forum?-)

Work is still preliminary, but we expect to have something stable for the ojs 3.2 release (in January).

Here you have the repo:

And the images in docker-hub:

As you will see, we are planning an structure to be as flexible as possible, to run over some OSs, php versions, databases, environments (dev, prod, demo), and of course… web servers.

Feel free to add an issue to the project or contribute with a PR so we can discuss in github around the technical details. If you are going to use docker in your day by day work, may be you also like to join the team.


[1] Just to clarify… I abandoned my Dockerfile to join efforts with Lucas, but “dojo” script is still alive. I just stop it’s development because the script don’t have any sense without an stable Dockerfile. I will keep working on it soon.

Great… I missed to read your first post… sorry. :smiley:

You did a great work @KRONWALLED. Thanks.

If you take a look to the pkp docker-ojs repo you will see we are in a process of migration from our former folder structure approach to a “docker official” upgrade script… that will generate the structure for us based on templates.

Templates will be something like this “Dockerfile-alpine-apache-php7.template”.

If we create a nginx template, will be enough for you?
Do you want to crate your own nginx template so we can integrate it in the project?

A nginx template would be enough. If I can help I’ll happily do it :slightly_smiling_face:

I like the template approach.
Will prepare a nginx template and get back to you. (Could take a few days. Need to find time somewhere :+1:)

1 Like

Can’t edit the last post. :thinking:

Hi @marc

I forked the docker-ojs repository and implemented a (not battle-tested) working nginx configuration.

You can have a look at GitHub.

What I did:

  • Created nginx Dockerfile template
  • Created folder structure inside 3_1_2-2
  • Updated update.sh to support multiple webservers
  • Added environment variables for database driver (e. g. mysqli) and database host (e. g. ojs_db_pkp)
  • Updated ojs-pre-start script to enforce those variables inside $OJS_CONF
  • Updated docker-compose.yml
  • Updated configuration files

The template should be ready to run via docker-compose build && docker-compose up as the image won’t be in any hub right now :slightly_smiling_face:

1 Like

Thanks a lot @KRONWALLED. All the changes you made look great to me. @Dulip_Withanage and David. Any comment?

BTW, do you want to PR the changes to the official repo or should we do it in your behalf?

With nginx over the table, we will need to think a little about the images tag-names in docker-hub, but with a little work this xmas I think we can open it all at same time than ojs 3.2.

@KRONWALLED and @marc thanks

nice work. specially nginx is lighter than apache, I think, we sould incorporate it in the main repository.

@KRONWALLED, if you like, please send a PR to the official repository.

sent the PR.

With nginx over the table, we will need to think a little about the images tag-names in docker-hub

Yep ran against this problem. For now I just appended -nginx to the version tag but I guess there should be a real strategy how to handle this :+1:

1 Like