Reputation: 661
I started working with Docker for WordPress. I followed the docker documentation to get it up and running:
https://docs.docker.com/compose/wordpress/
I added volumes for the plugin & theme directory.
When ran the command docker-compose up -d
the first time and went to http://localhost:8000/ i saw the installation of WordPress. When i rebooted my PC and started the services again with: docker-compose up -d
or docker-compose start
i got the error message: ERR_EMPTY_RESPONSE.
I tried:
Currently I have no idea why it isn't working anymore. I am working on macOS
This is my current docker-compose.yml
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
volumes:
- ./plugins/my-plugin:/var/www/html/wp-content/plugins/my-plugin
- ./themes/my-theme:/var/www/html/wp-content/themes/my-theme
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpres
volumes:
db_data: {}
The status of containers after running it:
Upvotes: 0
Views: 2155
Reputation: 727
Follow these steps
docker-compose down
- twice docker-compose up -d
Alternately,
docker-compose down
- twice {removes the network as well}docker system prune --volumes
docker-compose up -d
Upvotes: 2