I’m currently working on a website with the Bolt CMS. For this website, I am using an extension. Now, the “problem” with is that they are installed using Composer by , and end up in the .gitignore’d vendor/ directory. Which is OK while developing, because the extension will just be in my local codebase, but once I commit my changes and push them, I run into a little problem.

Some context

Let’s start with a bit of context: Our current hosting platform is a bunch of Digital Ocean droplets managed by Rancher. We use Gitlab for our Git hosting, and use Gitlab Pipelines for building our containers and deploying them to production.

The single line solution

In Slack, I checked with Bob to see what the easiest way was of getting the extensions installed when they’re in the configuration but not in vendor/, and the solution was so simple I had not thought of it:

Run composer install --no-dev in your extensions/ directory

So I adapted my Dockerfile to include a single line:

RUN cd /var/www/extensions && composer install --no-dev

I committed the changes, pushed them, Gitlab picked them up and built the new container, Rancher pulled the new container and switched it on, and lo and behold, the extension was there!

Sometimes the simple are actually the best



Source link
thanks you RSS link
( https://leftontheweb.com/blog//02/23/-bolt-extensions-on-docker/)

LEAVE A REPLY

Please enter your comment!
Please enter your name here