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

Clone Docker #1

Open
lexsoft00 opened this issue Oct 27, 2017 · 4 comments
Open

Clone Docker #1

lexsoft00 opened this issue Oct 27, 2017 · 4 comments

Comments

@lexsoft00
Copy link

Hi,

I'm new to Docker, tried your config and works very good.

I would like to clone the containers like from dev1 to dev2 so I can try something on dev2 but would like to keep the settings from dev1, I see that you can do a fresh start, but I only want to reach dev1 stable and then clone dev1 to dev2 dev3 dev4 and try different things. Since the script is making more than 1 container, do you know an easy way to group the containers and clone them?

@glaux
Copy link
Owner

glaux commented Oct 30, 2017

I'm not completely sure what you want to do, but if I understand correctly you would like to test several drupal installations on the same general server settings?

I think I would just copy the project folder to 'project2' and change line 6 in the docker-compose file to reflect this change. when you spin up the system with docker-compose up the new drupal project will be built.
Note however that the new installation would use the same database unless you modify that in the compose file as well, but at that point it might be easier to start the containers directly from docker cli (I've never done this myself, but there are a lot of guides on this on the web).

@lexsoft00
Copy link
Author

Would you mind setting up an example? What you are saying is right I would like to have more projects running on the same general server.

I've done the changes in docker-compose file but when I do docker-compose up it's still running the first project and not adding the image for the second project.

Could you post the changes here or do a git patch?

Thanks

@glaux
Copy link
Owner

glaux commented Oct 31, 2017

Take a look at the branch 'multiple' that contains my idea.

It works somewhat, but they are alle sharing the same database, and that messes with the drupal cache.
But since the mysql-container have persistent storage, you might just set up the databases for the projects manually after the first run of docker-compose up.

I had to duplicate the environment config file, soft linking doesn't work, and the environment file has to be within the project folder to be included in the image (to have the values copied to settings.php). That is definitely not optimal.

That's the best I can do for now I'm afraid, I'm no expert either :P

@lexsoft00
Copy link
Author

Seems that they share the same drupal base code and the same database. I will try to spend some time to see if I can work something.

Also did manage to add drupal console to the project and works great.
To the drupal docker file I've added the following code:

Install Drupal Console

RUN curl https://drupalconsole.com/installer -L -o drupal.phar &&
mkdir /usr/local/bin/drupal &&
mv drupal.phar /usr/local/bin/drupal &&
chmod +x /usr/local/bin/drupal &&
sed -i '$ a alias drupal="php /usr/local/bin/drupal/drupal.phar"' ~/.bashrc

You still need to install with composer the drupal console in the HTML folder but the drupal launcher works.

I've tried logging in the PHPMyAdmin but can't seem to login with root, only with drupal user.

Also, i wanted to thank you for your work. I've tried the wodby docker for drupal, it works fine, it's just so slow on my computer. Compared to this docker I would say that wodby is 3 times slower. I am running on a mini mac on IOS High Sierra.

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

2 participants