Local Wordpress env with Docker Compose - cURL error 7: Failed to connect to localhost port 8080: Connection refused
docker, docker-compose, wordpress
Solution
Following on from papey's answer. curl is trying to connect on the outside port (8080 in your case) whilst inside the container (80).
After much Googling and the only solution people gave was changing the inside and outside ports to 80:80. This is not feasible if you are running another service on port 80.
My solution was to modify the Apache2 conf inside the container so that Apache will respond inside on the outside port. There may be better ways but this is working.
/etc/apache2/ports.conf
Listen 80
Listen 8080
/etc/apache2/sites-available/000-default.conf
<VirtualHost *:*>
Problem
I am trying to set up a local Wordpress environment using Docker Compose for the first time. I am currently able to access my Wordpress instance on `localhost:8080` and have the files mapped locally. I purchased a theme, added it to `wp-content/themes`, and was then prompted to install some required plugins for it. When I click `Install`, this is the error I receive: `Download failed. cURL error 7: Failed to connect to localhost port 8080: Connection refused` Here is my configuration file: ``` version: "2" services: my-wpdb: image: mariadb ports: - "8081:3306" environment: MYSQL_ROOT_PASSWORD: password my-wp: image: wordpress:latest volumes: - ./:/var/www/html ports: - "8080:80" links: - my-wpdb:mysql environment: WORDPRESS_DB_PASSWORD: password ``` Probably a simple fix, but I can't seem to figure it out. Thanks!