6

Has anyone had success with setting up Craft using Docker?

I've stumbled across some Dockerfiles for WordPress and other CMS's but couldn't find much in the way of Craft. I'll be exploring this a bit myself over the next week, but was hoping some people in the community may have a few good pointers or tips or even cautions.

To elaborate, I'm looking for alternatives to MAMP as well, or other development environment tools for working with Craft.

1
  • I've been looking at Docker too, I'll be watching for your findings!
    – Tim Kelty
    Nov 11, 2014 at 12:43

7 Answers 7

2

I've been using Laravel Homestead for local dev (and Forge controlled VPS' for staging). Both have been hugely successful for me – I've not touched MAMP for months.

Craft works off-the-shelf with both.

8
  • Niceeeeeee. Thanks for this. Giving it a shot now! Nov 17, 2014 at 16:37
  • I notice Homestead 2 was just announced today, I've not had a chance to try this version yet but I'd guess it should all be fine. Nov 17, 2014 at 16:39
  • I'm giving it a shot now. Will let you know my success as well. Nov 17, 2014 at 16:59
  • This may (or may not) be helpful: laracasts.com/lessons/say-hello-to-laravel-homestead-two Nov 17, 2014 at 18:06
  • So it definitely works. However, I noticed that once I run homestead destroy, my database is purged. Do you connect to a remote database or one locally? If locally, how do you keep it from being destroyed when you restart your machine or homestead? I did notice the suspend command, but wonder what happens if I forget :x Nov 18, 2014 at 3:42
2

I am creating an image to help me test Craft.

https://github.com/gabrielmoreira/docker-craft

2

For anyone who is interested - I did a quick mashup of the Craft and Laravel Homestead documentation to outline the process I went through for setting up my first Craft site locally on a Vagrant/Homestead box.

Thanks to the guys over at Straight Up Craft for the video about Vagrant and Craft which introduced me to Homestead

https://medium.com/@mattcollins_6/setting-up-a-local-dev-environment-for-craft-cms-using-laravel-homestead-2724be3954a5

1

You might want to check out this tutorial on using vagrant with craft. You could use this as an alternative to MAMP. http://straightupcraft.com/articles/setting-up-craft-with-vagrant

2
  • Awesome thank you. Nov 17, 2014 at 16:38
  • Cool this actually touches on more options other than homestead as well. I got homestead working, and will be giving Forge a go again in light of all this, as well. Nov 17, 2014 at 18:25
1

Yes I have. I even wrote an article that describes the application I created to automate the install process less than two minutes.

CraftCMS + Docker Dev Environment in seconds

1

As of today the Craft docs note deprecating Nitro in favor of DDEV or similar projects.

There is also some good content on Craft Quest about using DDEV.

0

Here's a Docker setup for Craft CMS as a Composer project:

https://github.com/nystudio107/craft

Here is a full Craft website in Docker that you can spin up locally:

https://github.com/nystudio107/devmode

...and here is a comprehensive article on the Docker setup:

https://nystudio107.com/blog/an-annotated-docker-config-for-frontend-web-development

related:

https://nystudio107.com/blog/dock-life-using-docker-for-all-the-things

1
  • That docker article is super in depth. Probably a really good option for those who want to roll their own setup and are afraid to get their hands dirty! Aug 24, 2022 at 15:10

Your Answer

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

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