vscode-dev-containers icon indicating copy to clipboard operation
vscode-dev-containers copied to clipboard

Add Wordpress .devcontainer scripts.

Open PiotrCzapla opened this issue 3 years ago • 3 comments

I have a wordpress .devcontainer scripts that solve some of the pain points of wordpress development and work natively on M1. Unfortunately I've found this repository after I've had built the scripts and it large chunk of the code are already in PHP.

I can contribute to php, but I wordpress development is quite different compared to the modern PHP so I think it make sens to have a config set designed for it.

The things that are different are :

  • wordpress needs a domain name, otherwise it will redirect you all the time to a canonical url,
  • development of wordpress plugins or themes needs a copy of wordpress that can't be installed simply by composer, official wordpress container has few tricks to help with that.
  • often there are repos with wordpress code, all plugins and custom code mixed. (this is encouraged by most hosting providers)
  • you can't develop without a database, and creating database / fetching it, is not so easy as wordpress stores the domain name in the database.
  • wordpress is unusably slow when source code is on a mounted volume in macos (I've tried multiple bind options).

Given the above Having a clean way to run wordpress using devcontainers or codespaces seems like a good idea but I would to hear your opinion before I start converting my scripts to use the one from this repo.

How do you envision database here, is it okey to use docker-compose with codespaces or is it better to use php & mariadb as mentioned in #1021?

PiotrCzapla avatar Nov 19 '21 12:11 PiotrCzapla

I see why you are not using docker-compose in the template files, the workspace path needs to be hardcoded in the config file then.

PiotrCzapla avatar Nov 20 '21 07:11 PiotrCzapla

There is another issue with wordpress, it hates when it url changes and port forwarding in vscode has a random port. I spend quite some time fix this, so It definitely needs a new container template.

Btw. Here is the current code that uses docker-compose and is based on wordpress image. https://github.com/PiotrCzapla/vscode-wordpress

PiotrCzapla avatar Nov 20 '21 14:11 PiotrCzapla

Since then the container was tested with GitHub code spaces and all detected issues where ironed out.

PiotrCzapla avatar Jul 30 '22 08:07 PiotrCzapla