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

Composer missing in default docker image #242

Open
xcellenceit opened this issue Jul 8, 2023 · 19 comments
Open

Composer missing in default docker image #242

xcellenceit opened this issue Jul 8, 2023 · 19 comments
Assignees

Comments

@xcellenceit
Copy link

From default latest image mautic:v4-apache I believe that composer is not installed or supported.

This should be part of default image as based on documentation I get this is going to be default way to install extensions.

@vinyll
Copy link

vinyll commented Feb 14, 2024

Same for mautic5 images.
Any chance to bundle the composer command so the marketplace would work out-of-the-box 📦 ?

@andrew-dixon
Copy link

+1 for this, I just updated to v5 and need to installed the Symfony Mailer for Sendgrid and the documentation on shows how to do this using composer.

@andrew-dixon
Copy link

Just realised composer is already there in the bin directory, so if the documentation could be updated to show this in the command, as it does for the console commands, e.g. bin/composer ... instead of just composer ... that would be helpful.

@vinyll
Copy link

vinyll commented Feb 20, 2024

it is. However it's not made runnable.
Doing so manually within the docker made the message disapear however I still can't install from the marketplace with an error I can't understand.

@brianroyce
Copy link

So, the composer does not work on Docker, and you can not install Symfony Transports. However, it is in the container it is missing any updates on this?

@escopecz
Copy link
Member

I have the same issue. If I want to build my own docker file on top of the official one just to install an additional theme:

FROM mautic/mautic:5.0.3-apache
RUN composer require chimpino/theme-air

Then it fails on composer not being installed.

Composer is actually being installed in the original dockerfile, however, there is additional FROM that starts over. Perhaps it would be better to keep Composer and even NPM in the production image as it can get handy from time to time. @mollux WDYT?

I tried what was suggested above to use Mautic's composer:

FROM mautic/mautic:5.0.3-apache
RUN php bin/composer require chimpino/theme-air

But it fails with #5 0.562 Could not open input file: bin/composer

@mollux do you have some suggestion of how to do it properly?

@mautibot
Copy link

mautibot commented Jun 7, 2024

This issue has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/trouble-adding-ses-plugin-to-a-dockerfile-so-i-can-build-my-own-image/32046/3

@mautibot
Copy link

This issue has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/understanding-the-installation-of-mautic-5-via-docker/32063/4

@Bamstian
Copy link

This issue has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/understanding-the-installation-of-mautic-5-via-docker/32063/4

The thread is closed and referencing this GitHub-Issue. 😂

@angelomiloch
Copy link

@Bamstian It's just that in the thread this Issue was mentioned as a place where the same topic was being debated. So, I brought it here too.

@leikoilja
Copy link

any updates on this? just installed fresh mautic using docker-compose provided and there is no composer anywhere to be found

@angelomiloch
Copy link

any updates on this? just installed fresh mautic using docker-compose provided and there is no composer anywhere to be found

I don't believe so! In my case, I created a Dokerfile "FROM mautic/mautic:latest" and asked to include Composer and NPM in it. So, when I run the container, Mautic already comes with Composer and NPM. But I confess that I didn't test this in production.

@O-Mutt
Copy link

O-Mutt commented Jul 19, 2024

Perhaps it would be better to keep Composer and even NPM in the production image as it can get handy from time to time. @mollux WDYT?

This feels like a bad design decision IMO. If you allow npm/composer in the production image then the image is no longer immutable and can be modified and broken on the next update.

The ability to control what gets installed via an environment variable could be a path that could lead to a happier outcome, possibly.

@escopecz
Copy link
Member

@O-Mutt I agree. But the containers are mutable if the user wants to do so whether there is composer installed or not. They can simply install it, right?

But to get around that, I created my own docker file which allows me to install plugins and themes if anyone is interested:

https://github.com/escopecz/docker-compose-mautic/blob/main/Dockerfile

I can't wait for a proper solution.

@O-Mutt
Copy link

O-Mutt commented Jul 22, 2024

If you MUST you could run
apt update && apt install git npm nodejs -y
cd /var/www/html && PHP bin/composer require symphony/amazon-ses or whatever the composer package you wanted was

@escopecz
Copy link
Member

@O-Mutt What do you mean by "If you MUST"? Mautic is an extensible system. There should be a clean and easy way to install extensions.

If you look at the Dockerfile I shared, that's what's happening there. But a global Composer must be installed otherwise it's confused about the paths.

@O-Mutt
Copy link

O-Mutt commented Jul 22, 2024

My comment wasn't in reply to you it was in the thread in general it seems people were having trouble using the composer file that was already in place. I haven't had a chance this morning to look at the docker file that you provided but I'm sure it is very similar to the one that I have locally as well. That said it seems like a loose end from the project as a whole. Adding a mail transport should not require a custom image, at least not from my perspective.

@escopecz
Copy link
Member

It's not necessary to add a mail transport. SMTP is there by default. But the core code cannot have transports ready for all the ESPs out there. Those should be plugins.

@physx2494
Copy link

This is issue is aggravated even further in mautic 5 since, there is essentially no bulk email sending service but SMTP. Not having a clean composer makes the container essentially mutable, It would be excellent if environment variables are introduced to expose the plugin and theme installations.

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

No branches or pull requests