4

This is what I have accomplished up to now. Written a docker file where I have done the following and for now I have not used the docker compose.

  1. Used alpine as base Os
  2. setup nginx
  3. setup php-fpm
  4. Installed magento2 file

So my docker build is ready and the container is ready and can see the setup page when opening it on the browser.

enter image description here

My problem How do I automate this Magento2 installation process from dockerfile. Like setting up database and the other installation process.

2

2 Answers 2

1

Instead of creating a dockerfile yourself you could also pull a docker image, e.g. alexcheng/magento2.

1

I'm going to talk about general process here, rather than addressing Magneto specifically, so that it's useful to more people and situations.

How do I automate this Magento2 installation process from dockerfile. Like setting up database and the other installation process.

Run through the wizard process once. Track down the files it generates, which isn't straightforward and may require a few tries. Pull those configuration files into your app configuration, and try a fresh container that just uses those.

That is, reproduce what the installation wizard is doing in your own configuration tool. This sounds difficult, but often the wizard is complex because it needs to address many situations, and you are fine hard-coding many things for your specific situation.

As a final note, since we're talking about Docker, presumably the database resides on another machine. Therefore, you only need to set it up once, and that process will be part of its provisioning, not this container's.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.