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

Adjust Dockerfile to take advantage of docker caching #1219

Conversation

jasonhildebrand
Copy link
Contributor

I've upgraded archives.mhsc.ca to AtoM 2.6 - it's now hosted using docker. Kudos to you for your work on AtoM and your work to dockerize it!

I've worked with your Dockerfile a bit in updating our customizations and theming. One pain point I hit was that lessc (from make -C /atom/src/plugins/arDominionPlugin) failed due to a theming customization on our end. Fixing and re-running meant re-building the entire container. That meant several very slow iterations while I fixed that up.

I am submitting this PR which re-organizes your Dockerfile a bit. The local source tree almost always has changes from the previous build, so docker can't usually use any cached steps below COPY . /atom/src. The main idea in the PR is to move the COPY lower down in the file to allow docker's cache to work. Building PHP doesn't depend on the codebase, so it's not necessary to have COPY above the PHP build.

I also added the fcgi package - this allows a docker healthcheck to be defined in the atom container which tests that PHP-FPM is running and producing expected result (I can share the healthcheck code if you are interested).

Copy link
Contributor

@jraddaoui jraddaoui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @jasonhildebrand, thanks a lot!

We had a similar version of this changes that we're using for some CI tests in a personal fork, but it never made it to vanilla, so we appreciate you bring this up.

I've added a couple of minor suggestions below and I'd appreciate if you can change the commit message, to reference the Redmine ticket I just created for this matter and to wrap the subject to 50 chars. Something like "Adjust Dockerfile, refs #13441", then an empty line and the body wrapped to 72 chars lines, if you want to explaining the changes a bit more.

Regards.

&& make -C /atom/src/plugins/arDominionPlugin \
&& make -C /atom/src/plugins/arArchivesCanadaPlugin \
&& composer install -d /atom/src


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line.

@@ -6,8 +6,6 @@ ENV FOP_HOME=/usr/share/fop-2.1 \

COPY --from=composer /usr/bin/composer /usr/bin/composer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to move this layer too, just in case there are changes in the composer executable.

@jraddaoui
Copy link
Contributor

Thanks again @jasonhildebrand!

I've moved it to #1247 with the suggestions I mentioned.

@jraddaoui jraddaoui closed this Jan 26, 2021
@jasonhildebrand
Copy link
Contributor Author

OK, great. Thanks for going ahead and fixing this up - I had already moved on to a different project and wasn't able to get back ot this.

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