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

Smaller container #54

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

trin4ik
Copy link

@trin4ik trin4ik commented May 25, 2024

What was changed

More order in Dockerfile for php instance.

Why?

  • Old container have size over 900mb, new container size is 270mb
  • Layers for more build performance and k8s-ready

Прогнал все примеры на работоспособность с новым контейнером, вроде пашет, но я недавно общаюсь с темпуралом и не уверен, что все результаты были верными.
По сути это просто оптимизированный контейнер, который и весит меньше и его проще переносить в продакшен. Если подобное тут не нужно, в примерах, то никто и не расстроится )
Если же подобное актуально -- я бы ещё потестировал и подправил бы compose файл.

More order
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@trin4ik
Copy link
Author

trin4ik commented May 25, 2024

По сути это просто alpine сборка. Убрал docker-php-ext-install/docker-php-ext-enable в пользу install-php-extensions. Перенёс все внешние бинарники максимально высоко, чтобы при изменении чего либо не делать лишних действий, так же разбил докерфайл на 3 слоя.

  1. билд php со всеми зависимостями + скачивание бинарников
  2. сборка vendor директории
  3. сборка автолоада.

2 и 3 шаг нужен, чтобы опять же не пересобирать composer целиком, если у вас просто поменялся код. экономит время в ci.

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