Looking for a Docker + Sage9 setup so even less tech-savvy team members can work on a project

Since last week I have a kinda working Docker + Sage 8 setup that starts the dev environment with just one command docker-compose up (everything works except BrowserSync).

And now I want to create the same setup for Sage 9, because last time I installed Sage 9 locally all my Sage 8 websites wouldn’t start anymore, so I like to run them in a VM like Docker.

I copied the setup from Sage 8 and modified it to run with Sage 9, it is working except it is not showing the CSS changes when I edit them, the changes are only visible when I destroy and rerun the containers again.

Is anyone doing something similar like this and would like to share their setup?

For anyone interested here are the GitHub repo’s for all the necessary containers to run inside Docker, they are far from perfect, but it took me a lot of trial and error to get here:

What I still have to figure out is having Docker run with a argument so it runs the production environment.

Again I want to have a setup so that I can invite anyone to help me work on a project, so that they only have to rung docker-compose up and don’t have to worry about having the correct environment setup on there machine, the only thing they have to worry about is how to write PHP, CSS and JS

1 Like

Hey mvaneijgen,

I’ve got a setup working too, along with bedrocks, but what seems to be webpack, is messed up. For starters, when scss files are correctly updated, js file changes, start an infinite reloading on the browser. Which only stops when stopping the container. It’s frustrating.

Any improvement on your side?

Hey, no improvements. I am still not using Sage 9 because it will break all my previous build Sage 8 sites which means I couldn’t support them any more, which is not really something I can do.

I am using https://github.com/visiblevc/wordpress-starter for that purpose, they have an example for you to play around here

i do habe a new-wp-project.sh which pulls some plugins and generatates a folder structure i prefer
eg themes/projectname clientdata/ plugins/projectame

it works well, though a little manual work is needed and there are prerequisits as i am on windows platform, one qould need linux subsystem and composer install ready

so i fire up my project with
cd wp-projectname
docker-compose up -d
cd themes/projectname
yarn run start

wp-cli and and the wordpress itself is accessible via
docker-compose exec wordress bash
and one can export e.g. devdb.sql for teamwide db content (using git-lfs)

everything works pretty well (excep yarn run build:production but that is another topic)

so the bash script scaffolds everything for a consistent project which lives in a git repository

next step would be continious delivery with bitbucket pipelines or gitlab that would be awesome… maybe someday :wink: and a self hosted plugin and theme repository so that manual (s)ftp becomes a thing of the past, would love some pointers for such a thing…

Hey b0r7, we have continuous delivery working via CircleCI with deployment to WPEngine and it shouldn’t be hard to adapt that to BitBucket or GitLab. I’m happy to share our yml file for that.

We aren’t using a docker workflow yet though so I look forward to reading your take on that. One of us uses vvv and the other uses MAMP and we are hoping to standardize on Docker + Lando or similar.

@slam - I’d love to see your yml. I’m looking to setup a similar dev environment (CircleCI => WPEngine).

As I mentioned in another thread, to make this repo I stripped out stuff that was specific to our install and have not tested this as a generalized process. You might need to troubleshoot parts.

I also recently needed to update the circleci container to match changes at WPE (php 7.2).

This is a very basic deploy — it only loads enough code to run yarn run build:production and it’s not creating a full WordPress install. No testing is happening in Circleci (aside from build pass/fail).

Not to animate a zombie thread, but we’ve switched to Lando (a docker wrapper) and it’s been working mostly great. The only caveat is we were running browsersync locally, not on the container. This worked great for a while but onboarding a new dev is painful. So we want to run in the container.

I have most of it working — configured a node service, yarn works, yarn build:production works. But yarn start does not work; can’t figure out how to configure the proxy to the proxy, how to map the ports.

You get this working?

You can try out my Docker image, I’d like some feedback on it. Dev tools are all working (as far as I know).