Docker Compose Wordpress Plugin Does Not Install: Connection Refused

Asked

Viewed 104 times

0

I’m trying to create an application in wordpress, through Docker, however plug-ins are not getting installed:

Docker-Compose.yml:

version: '3'

services:
    mysql:
        image: mariadb
        ports:
            - "3260:3260"
        volumes:
            - mysql_data:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: example

    wordpress:
        image: wordpress
        ports:
            - "2000:80"
        volumes:
            - ./wordpress_data:/var/www/html
        environment:
            WORDPRESS_DB_PASSWORD: example
        depends_on:
            - mysql
        links:
            - mysql

volumes:
    mysql_data:
    wordpress_data:

When opening localhost:2000, and entering all necessary information, in the plugin installation menu I get the following error message:

Installing Plugin: WPBakery Visual Composer
Baixando pacote de instalação a partir de http://localhost:2000/wp-content/themes/altius/fastwp/plugins/js_composer.zip…

Falha no download. cURL error 7: Failed to connect to localhost port 2000: Connection refused
  • It is trying to download the package from inside its own container, and if it does not have this path, or this plugin, Curl will not work. Try installing the latest version of PHP in your Docker Compose. Let me know the result.

1 answer

1

Wordpress is not so smart to know that its url is different from the request url. So you should use both on the same port. If for your wordpress apache port is 80, in the container expose port 80 also and use it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.