- Clone this repo
- cd
wordpress-docker
- run
docker-compose up -d
- run
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2bb5949a7e8d wordpress:latest "docker-entrypoint.s…" 41 minutes ago Up 23 minutes 0.0.0.0:2021->80/tcp wp
2216ce37099f mysql:5.7 "docker-entrypoint.s…" 41 minutes ago Up 23 minutes 3306/tcp, 0.0.0.0:2022->33060/tcp wp-db
- Login to your dcker container, in this case CONTAINER ID of
wp
container,
docker exec -it 2bb5949a7e8d bash
Run these commands inside this container,
chown -R www-data:www-data /var/www
find /var/www/ -type d -exec chmod 0755 {} \;
find /var/www/ -type f -exec chmod 644 {} \;
cd wp-content
mkdir uploads
chmod a+rwx -R uploads
exit
-
After exit from container, restart container with
docker-compose restart
-
Complete WordPress installation when you open
http://localhost:2021
-
Now you can install themes or plugins from within wp-admin.