The Stater WordPress development with Docker.
Create new env file, update all variables with correct values
cp .env.sample .env
Start Docker Compose:
docker-compose up -d
Stop Docker Compose:
docker-compose stop
Remove Stop Container:
docker-compose down
Contain the mount volumes for Docker.
/
├── .db
├── plugins
├── theme-src
├── theme
│ ├── acf
│ ├── assets
│ ├── fonts
│ ├── img
│ ├── inc
│ ├── template-parts
│ └── templates
│ index.php
│ style.css
└── uploads
After start Docker compose. Then, Open the web browser and follow the installation instruction.
When the WordPress successfully installed. The database will be created and stored locally on /.db/data
.
The theme might not displayed properly without follow plugins:
- Login to the WordPress adminstration area.
- Open Themes setting from the menu
Appearance > Themes
- Set the active theme
- Open Plugins setting from the menu
Plugins > Installed Plugins
- Activate plugins
Open the /theme
and /theme-src
. Then modify the files as needed.
The /theme-src
designed for source of assets which doesn't required on production. So, they separated from theme.
Following the WordPress Developer Handbook for theme development. For the the theme's asset files (CSS, JavaScript), Node.js 10.x+ is required.
Plugins should be ignored as it should be installed on installation site.
Uploads are also ignored by default.
Install the required packages with npm:
npm install
Start the script to compile the assets and watch for the file changes:
npm start
Gulp will watch the file on /theme-src
to compile to JS and CSS.