Shifter Local is an easy-to-use tool that helps you set up a local WordPress environment for plugin and theme development. It requires no configuration, so it's quick and easy to get started.
Shifter-Local is released for the purpose of only checking the operation of WordPress theme and plug-in in Shifter platform.
The following features, combined with the Shifter platform. do not work on Shifter-Local.
- All Shifter menus in WordPress dashboard
- Terminate, Generate, or etc...
- Passwordless login
git clone https://github.com/digitalcube/shifter-static-local.git my-shifter-site
cd my-shifter-site
docker-compose up
or
npm run start
Testing "Create Shifter Site" (Similar to Create React App npx create-react-app)
Step 1:
git clone --branch feature/scripts https://github.com/digitalcube/shifter-static-local my-shifter-site
Step 2:
cd my-shifter-site
Step 3:
npm run start
Visit https://127.0.0.1:8443 in your browser.
Use Ctl + C in your terminal window to stop running containers.
to run in the background, use -d option.
docker-compose up -d
Docker Desktop for Apple Silicon
Using the docker-compose.yml config file.
docker-compose -f docker-compose.yml -f docker-compose_arm64.yml up
Using the Docker platform flag.
docker-compose -f docker-compose.yml up --platform linux/amd64
Considering file permissions, we recommend using volumes on Linux.
docker-compose -f docker-compose.yml -f docker-compose_linux.yml up
docker-compose pull
You can use any tag from the following provided.
latest,7.4: Similar as Shifter production environment.develop: development edge.
NPM scripts are also available.
npm run start # Starts site
npm run stop # Stops site
npm run clean # Deletes Docker data
npm run reset # Deletes all data
modify docker-compose.yml like below
- image: getshifter/shifter_local:latest
+ image: getshifter/shifter_local:7.4
- available tags => getshifter/shifter_local Tags - Docker Hub
- MacOS
./volume/app:wordpress/wp-contentfiles./volume/db:mysqldatabases
- Linux (detect path using
docker volume inspect)/var/lib/docker/volumes/shifterlocal_app/_data:wordpress/wp-contentfiles/var/lib/docker/volumes/shifterlocal_db/_data:mysqldatabases
All data will be persisted in these directories, even if the Docker containers are stopped.
To start over with the installation, simply run make clean.
The included mysql version has been changed from 5.6 to 5.7. If you want to keep the data, you can upgrade after starting docker-compose with the following command.
$ make mysql_upgrade
Some plugins and themes may conflict with Shifter. Conflicts usually cause the Generator to hang or fail. Here are a few tips.
Your site should return a list of valid URLs in JSON format for Shifter to crawl for generating.
Add ?url=0 to the websites URL to test.
https://127.0.0.1:8443?urls=0
If the number of pages to be generated is more than 100, you can check the target by 100 pages by increasing the number of the urls parameter. (e.g. urls=1, urls=2)
Pages that do not appear in this list are not subject to generate.
Common problems and solutions when there are no pages in the list are as follows.
- pagination issues. (Work in progress)
While running your site on Shifters production environment PHP warning are suppressed. These warning if any are visible while running Shifter-Local for debugging your theme.
To use WordPress like subdirectory installation, follow the steps below.
- open
docker-compose.ymlto edit - remove
#fromSITE_SUBDIRline and set subdirectory name
$ docker-compose exec --workdir /var/www/html/web/wp --user www-data wp /usr/local/bin/wp --version
WP-CLI 2.4.0
$ docker-compose exec --workdir /var/www/html/web/wp --user www-data wp /usr/local/bin/wp user update 1 --user_pass=TYPE-NEW-PASSWORD
Success: Updated user 1.
$ docker-compose exec --workdir /var/www/html/web/wp --user www-data wp /usr/local/bin/wp core update --version=5.7-RC2
Success: WordPress updated successfully.
- Depending on your local environment mail functions may send from this container. Example: Under
Outbound Port 25 Blocking
This Docker image is similar to the one used by Shifter, but does not guarantee complete compatibility.