Skip to content

itiden/php-devcontainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Add a Docker Dev Container to your PHP/Wordpress project

Runs your PHP/Wordpress site in a Docker container using Dev containers.
No need to install PHP or database on your computer.

This setup is done to help setup your local development environment.
But can probably be used as a base for your production environment too with some modifications (but that is currently not the intent of this repo).

Prerequisites

  • Install Docker on your system (Docker Desktop for Windows and Mac)
  • Install VS Code extension Remote - Container

Installation

In the root of your Wordpress site, run npx tmplr itiden/php-devcontainer/tmplr.
This will prompt you with some questions where you can setup:

project_folder
Name the project folder in Docker.
(The path will be /home/wp/{{project_folder}})

web_root
Select web server root
(Relative to you repo root)

php_version
Select PHP version.

composer_version
Select Composer version

node_version
Select Node version.

mysql_version Select MySQL version.

post_create_command
Command to run after entering dev container.

Setup

Change your database connection details in your local Wordpress site to:

DB_NAME=wp
DB_USER=wp
DB_PASSWORD=secret
DB_HOST=db

Now start the containers by using the Remote - Containers extensions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published