[英]Wordpress & Docker. Trying to interact with WP Console incl updating problems
我使用了 Brad Traversy 的 YT 視頻“使用 Docker 快速設置 Wordpress”來啟動並運行 WP(參見下面的代碼)。 我已經啟動並運行了我的 WP 站點,但我有 WP 告訴我有可用的更新。 目前,如果我嘗試更新,這就是我在 WP 控制台中看到的內容。 我對 docker 完全陌生,之前曾在本地使用過飛輪。 我已經嘗試了任何我能想到的主機名,但沒有任何樂趣。 我為主機名輸入了什么?
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
當您使用 docker 撰寫時,應用程序不理解本地主機地址。
ftp 服務在哪個容器中運行?
例如,如果 ftp 正在 wordpress 容器上運行,則需要連接到wordpress
而不是localhost
,因為 Z1870A829D9BC24ABFE
但是,如果您 ftp 托管在您的主機中,請查看此答案How to access host port from docker 容器
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.