Use WordPress with Docker using Docker composeā
Dockerfile for extending a base image and install wp-cli
myapp.local./nginxphp.ini config in ./confignginx, wordpress and mariadbInstall Dockerā
cd cli && ./create-cert.sh
Edit the script to your your custom domain, this example uses myapp.local
cd cli && ./trust-cert.sh
Edit the script to your your custom domain, this example uses myapp.local
cd cli && ./setup-hosts-file.sh
Follow the instructions. For example use
myapp.local
cd src
cp .env.example .env
Use the following database settings:
DB_HOST=mysql:3306
DB_NAME=myapp
DB_USER=root
DB_PASSWORD=password
cd src
composer install
You can also use composer like this:
docker-compose run composer update
docker-compose up -d
š Open up https://myapp.localā
When making changes to the Dockerfile : Use
docker-compose up -d --force-recreate --build.
docker exec -it myapp-wordpress bash
wp search-replace https://olddomain.com https://newdomain.com --allow-root
Login to the docker container
docker exec -it myapp-wordpress bash
Stop
docker-compose stop
Down (stop and remove)
docker-compose down
Cleanup
docker-compose rm -v
Recreate
docker-compose up -d --force-recreate
Rebuild docker container when Dockerfile has changed
docker-compose up -d --force-recreate --build
Content type
Image
Digest
Size
137.5 MB
Last updated
about 7 years ago
docker pull concepts/cis