Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Dockerfile (Solution #3) #483

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wedi
Copy link

@wedi wedi commented Oct 7, 2018

This is my take on adding a Dockerfile to Polr.
There are already other approaches and I would like to add one more to the discussion.

In this solution I am using an official and community maintained PHP base image instead of installing everything from scratch. While one could manage to build a smaller image and nginx is said to be more performant than apache, I'd opt for the KISS solution that is easy to maintain and leave all special setups to the individual administrator.

Features:

  • Override Polr's .env configuration with docker environment variables.
  • Multi-stage build to avoid creating loads of layers.
  • Best effort to order everyting in a way that docker build caching helps reducing build time even when Polr source files have changed.
  • AllowOverride None is set and the .htaccess file gets integrated into the apache configuration to increase performance.
  • Most other values are left as is and can get adapted easily to personal needs by mounting custom configuration files into apache's or php's configuration folders.

Try it: https://hub.docker.com/r/wedi42/polr/

I am happy for suggestions to improve the code. Some documentation should be added before a possible merge. I'd just like to discuss this way of solving the task before putting more time into it.

* Uses an official php base image
* Multi-stage build to reduce layers
* Leverages docker build caching
@wedi wedi changed the title Add a Dockerfile Add a Dockerfile (Solution #3) Oct 7, 2018
@f0cus3d
Copy link

f0cus3d commented Oct 11, 2018

Gotta be honest this was what i was trying to build for a personal project. I particularly like the multi-staged build process.

f0cus3d
f0cus3d previously approved these changes Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants