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

Migrate Magento 2 Docker image #40

Merged
merged 18 commits into from
Jan 15, 2025

Conversation

mescalantea
Copy link
Contributor

What is the goal?

The Docker image currently used for development and testing is not longer maintained by Bitnami. Create a custom Docker image that meets our requirements and migrate the existing project to use the new image in place of the current one.

References

  • Issue: PAR-480

How is it being implemented?

This pull request includes significant changes to the Docker setup for Magento, including the addition of new Dockerfiles for PHP 7.4 and PHP 8, a new helper module, and a build script. The most important changes are detailed below.

Dockerfile Additions:

  • Added a Dockerfile for PHP 7.4 with necessary extensions and configurations for Magento Open Source. (.docker/magento/Dockerfile.php74)
  • Added a Dockerfile for PHP 8 with necessary extensions and configurations for Magento Open Source. (.docker/magento/Dockerfile.php8)

Helper Module:

  • Added a new helper module with a console command to set up data for quick testing. (.docker/magento/HelperModule/Sequra/Helper/Console/Setup.php)
  • Included the composer.json for the new helper module. (.docker/magento/HelperModule/Sequra/Helper/composer.json)
  • Added necessary configuration files for the new helper module. (.docker/magento/HelperModule/Sequra/Helper/etc/config.xml, crontab.xml, di.xml, events.xml, module.xml, registration.php) [1] [2] [3] [4] [5] [6]

Build Script:

  • Added a build script to create Docker images for different Magento and PHP versions, with validation for compatibility. (.docker/magento/build-image.sh)

Additional Configurations:

  • Added a PHP configuration file for Magento 2 requirements. (.docker/magento/docker-php-m2.ini)
  • Added an entry point script for PHP 7.4 to handle Magento installation and configuration. (.docker/magento/m2-entrypoint.php74.sh)

Opportunistic refactorings

Unused scripts were removed.

Caveats

Magento 2.4.3 image is not supported, because an Out of Memory error on runtime at the entrypoint script, that appears when composer is installing the modules. Seems that the root of the issue is the use of composer v1 instead of v2 for that particular Magento version. Some attempts to force the v2 were made without success.

Does it affect (changes or update) any sensitive data?

How is it tested?

Manual tests

How is it going to be deployed?

Standard deployment

mescalantea and others added 18 commits January 15, 2025 11:43
…and add new entrypoint script for Magento 2 installation
@mescalantea mescalantea requested a review from m1k3lm January 15, 2025 14:25
@m1k3lm
Copy link
Member

m1k3lm commented Jan 15, 2025

Great work Michel.
Congrats!

@m1k3lm m1k3lm merged commit 158ea76 into master Jan 15, 2025
6 checks passed
@m1k3lm m1k3lm deleted the refactor/PAR-480-Migrate-Magento-2-Docker-image branch February 2, 2025 20:37
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