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

(infra) Remove composer container and let laravel container install d… #27

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

alchalade
Copy link
Contributor

#25

The laravel conitainer explicitly installs the soap extension in order to use the soapClient. After evaluating both

  • "Creating a custom composer image "
  • "let the laravel container install the dependencies"

I decided to go with the 2nd option as having a separate composer container has no extra value over let the main php container install the dependencies.

How to test;

  • remove vendor directory
  • run docker-compose up --build this should already re-build the laravel container
  • expect to see the vendor directory in Website/htdocs/mpmanager/

@@ -17,6 +17,8 @@ services:
volumes:
- ./Website/config/php/php.ini:/usr/local/etc/php/php.ini
- ./Website/htdocs:/var/www/html
command: [ "sh", "-c", "cd /var/www/html/mpmanager && php composer.phar install" ]
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmohns oh very good catch thank you for this 🙏 . I totally missed that one.

@alchalade alchalade force-pushed the remove-composer-container branch 2 times, most recently from eee4f72 to 3e54054 Compare January 24, 2024 19:06
@dmohns
Copy link
Member

dmohns commented Jan 25, 2024

I'm trying to run this on my local machine after deleting the vendor directory.

Running docker compose up does indeed re-create the vendor directory and I can see output of composer in the logs. However, the container exists and doesn't keep running. This isn't intended right?

@alchalade alchalade force-pushed the remove-composer-container branch from 3e54054 to dbfe2f0 Compare January 25, 2024 15:22
@alchalade
Copy link
Contributor Author

@dmohns TBH I didn't checked it before I pushed the 2nd change. The weird thing is that the CMD form the base image got lost even though there is nothing in between that overwrites the CMD .

The defensive check in the .sh file should do the trick now.

@dmohns
Copy link
Member

dmohns commented Jan 25, 2024

@dmohns TBH I didn't checked it before I pushed the 2nd change. The weird thing is that the CMD form the base image got lost even though there is nothing in between that overwrites the CMD .

The defensive check in the .sh file should do the trick now.

Yepp, it works now. I will admit I don't fully understand why this happens, but that's fine 😉

LGTM

dmohns
dmohns previously approved these changes Jan 25, 2024
@alchalade alchalade force-pushed the remove-composer-container branch from dbfe2f0 to 876a552 Compare January 26, 2024 09:00
@alchalade alchalade merged commit 1277cfd into main Jan 26, 2024
8 checks passed
@alchalade alchalade deleted the remove-composer-container branch January 26, 2024 16:33
@dmohns
Copy link
Member

dmohns commented Jan 30, 2024

Little Github hack: You can use

Closes #25

syntax for this to automatically close the linked issue, once the PR is merged 😉

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.

2 participants