简体   繁体   English

Wordpress & Docker。 尝试与 WP 控制台交互,包括更新问题

[英]Wordpress & Docker. Trying to interact with WP Console incl updating problems

I've used Brad Traversy's YT video 'Quick Wordpress Setup With Docker' to get a WP up and running (see code below).我使用了 Brad Traversy 的 YT 视频“使用 Docker 快速设置 Wordpress”来启动并运行 WP(参见下面的代码)。 I've got my WP site up and running but I've got WP telling me there are updates available.我已经启动并运行了我的 WP 站点,但我有 WP 告诉我有可用的更新。 Currently if I try to update this is what I see in the WP console.目前,如果我尝试更新,这就是我在 WP 控制台中看到的内容。 I'm completely new to docker having previously used local by flywheel.我对 docker 完全陌生,之前曾在本地使用过飞轮。 I've tried anything I could think of for the hostname but no joy.我已经尝试了任何我能想到的主机名,但没有任何乐趣。 What do I put for the hostname?我为主机名输入了什么?

在此处输入图像描述

version: '3'
services: 
    #######  Database service  #######
    db:
        image: mysql:5.7
        volumes:
            # This gives us persistence
            - db_data:/var/lib/mysql
        # if the server reboots the container restarts
        restart: always
        # define your mysql environment variables
        environment:
            MYSQL_ROOT_PASSWORD: password
            MYSQL_DATABASE: wordpress
            MYSQL_USER: wordpress
            MYSQL_PASSWORD: wordpress
        networks:
            - wpsite
        

    #######  phpmyadmin service  #######
    phpmyadmin:
        depends_on: 
            - db
        image: phpmyadmin/phpmyadmin
        restart: always
        ports:
            - '8080:80'
        environment: 
            PMA_HOST: db
            # as above in the db service
            # your phymyadmin login is root/password
            MYSQL_ROOT_PASSWORD: password
        networks:
            - wpsite


    #######  Wordpress service  #######
    wordpress:
        depends_on:
            - db
        image: wordpress:latest
        ports:
            # local:8000, container:80
            - '8000:80'
        restart: always
        # okay so we want the WP install in the container to sync locally here
        # Mapping './' (local current folder) to '/var/www/html' (container's web root folder as we're using apache)
        volumes: ['./:/var/www/html']
        environment: 
            # the host is going to be the db service by mysql above, port 3306 is the default for mysql
            # we've already setup the DB user above
            WORDPRESS_DB_HOST: db:3306
            WORDPRESS_DB_USER: wordpress
            WORDPRESS_DB_PASSWORD: wordpress
        networks:
            - wpsite
            # map the volume of db_data (in service db above) and the network of 'wpsite'
networks: 
    wpsite:
volumes:
    db_data:

# Now go and run docker-compose up -d

when you are using docker compose, the apps do not understand the localhost address.当您使用 docker 撰写时,应用程序不理解本地主机地址。

in which container is the ftp service running? ftp 服务在哪个容器中运行?

for example, if the ftp is running on the wordpress container, you need to connect to wordpress instead of localhost because wordpress is the name of your service例如,如果 ftp 正在 wordpress 容器上运行,则需要连接到wordpress而不是localhost ,因为 Z1870A829D9BC24ABFE

but, if you ftp is hosted in your host, check this answer How to access host port from docker container但是,如果您 ftp 托管在您的主机中,请查看此答案How to access host port from docker 容器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM