Docker file for Trellis + Bedrock + Sage?


#1

Anyone who has a Docker-file for installing Trellis + Bedrock + Sage? I will use the “Docker on Ubuntu 14:04” image at DigitalOcean and it would be supersmooth to also have all these ready config…


#2

Hi @asterix, I am also interested in using Docker (after listening to Roots Radio Episode 3). It’s been 3 months since you posted this… Have you found any solutions elsewhere? Thanks!


#3

Just to be clear - you wouldn’t be using trellis if you used docker. You would, however, be using Docker+Bedrock+Sage.

Docker replaces Trellis in this type of an environment - here is an example that looks promising. Haven’t used it yet: https://github.com/xadamy/docker-nginx-hhvm-bedrock


#4

I’m working on this now. Anyone interested in testing etc. just email me and I’ll let you know when the repo is available.

ssteinerX


#5

@ssteinerX I’m interested! I need a rock solid docker image of trellis style bedrock for a resilient / scalable install on Google Cloud Platform.


#6

@ssteinerX Thanks for offer. I’ll be happy to test on 16.04 LTS


#7

@ssteinerX Ah great! Yes I’m definitely interested! I will run a 16:04 Ubuntu + Nginx + MariaDB now at Digital Ocean. I’m not sure if Docker is production ready yet though but at least I will run this on my local machine.


#8

@btamm oki I see, https://github.com/xadamy/docker-nginx-hhvm-bedrock seems promising though.


#9

Bit of an old thread but something interesting for sure.

I’m thinking this would be the best WP Docker project to leverage https://github.com/tutumcloud.


#10

So do have you anything ready to use yet?


#11

Yep, I’m looking to move to Docker too. It runs so much faster on my Macbook Pro than Vagrant, looks to be future proof and makes deploys to cheap servers like Scaleway possible e.g. 4 core ARM servers for 2.99 Euro per month: Scaleway ARM server prices

However I’m not even sure of the workflow required to create a Bedrock site from scratch on Docker, especially multisite.

For example, can I just clone Bedrock, update files (wordpress-sites.yml, vault.yml etc) and use it to do a standard WordPress Install inside a Docker container? Then modify it manually to make it into a Multisite???


#12

Typo or are you confusing Bedrock with Trellis? (those yml files are from Trellis).

You can absolutely run a Bedrock based WP site on a “normal” WordPress Docker image/container.

All Bedrock requires in addition to a regular WP install is the .env file and web server configuration for the /web/ web root.


#13

No typo Scott, just my mistake…! :slight_smile:

I mentioned those Trellis yml files because I was not sure exactly where Bedrock configuration ends and Trellis configuration begins… I’ve already done a successful Bedrock & Trellis setup and deploy via Bedrock Capistrano to my Cloud Hosting on vidahost.com.

You’ve answered my question in your reply. So is this the workflow for setting up Bedrock WordPress Multisite without Trellis in Docker/MAMP/Desktop Server etc:

  1. Clone Bedrock to local directory.
  2. Edit the .env file with local development site details.
  3. Set up .htaccess or nginx.conf in Bedrock /web directory.
  4. Run standard WordPress install from this using Docker/MAMP/Desktop Server.
  5. Manually update files to create a Multisite installation (not sure exactly which files as this was done automatically for me in Trellis).
  6. Deploy to Staging and Production using Bedrock Capistrano as before.

If this workflow is correct, I will try it using Docker and would be happy to write it up for others to use.


#14

The only Bedrock configuration/installation requirements are documented here: https://roots.io/bedrock/docs/installing-bedrock/

That’s completely independent of Trellis.

So you’d follow those steps and configure the web root as per step #4 in your Docker image. I’ve never done this myself, and it depends on the Docker setup, so I can’t provide exact details :slight_smile:


#15

Did the Docket setup ever pan out? End of March 2017 now and I was just looking into this.


#16

Guy who created the repo recommends not using Docker, but rather Ansible or Capistrano these days. See edited README


#17

Hmm, alright. I tried 4 different nginx docker repos before but actually had problems with them all, so he might be right… I might though try this locally on my Windows 10 laptop, just to give Docker a last chance…


#18

The author of the repository who recommended against Docker just didn’t know what he was doing when he was creating the repo.

There is no docker-compose.yml (container orchestration) there, he stuffed everything into one container.

In this case it’s indeed harder to debug. While after separating different processes into different containers it’s easier to debug. Running everything in one container is not the idea of Docker. Even WP-CLI should be one-shot separate self-removable container! For details, check out this post.

There is no magic pill (except docker images on https://hub.docker.com, but you have to get grips with Docker anyway). I encourage everyone to read Docker docs, explore Docker tutorials, and eventually you’ll get hooked for good.


#19

@mvasin If you could recommend a blog post where one sets up WordPress on a LEMP using Docker containers that would be great. One where you add Bedrock and or Sage of course.


#20

There is a new Docker option out there created by 10Up. Here a link to WP Docker’s repo. It is one based on an environment created by John Bloch apparently. You can read more about it on their blog here Especially interesting for local development besides Valet for me for starters, but also interesting for us all here as an alternative to Trellis and perhaps for the whole setup for development and deployment. But in the latter case more will be needed, especially for automated deployment.