Docker中的Wordpress返回垃圾字符(Windows 10)

时间:2019-02-19 18:45:08

标签: wordpress docker docker-machine

我正在使用Windows 10家庭版的Docker工具箱,并尝试创建基本的Wordpress设置。这是我的基本撰写文件。

version: '3'

services:
  # Database
  wordpress_db:
    image: mysql:latest
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
    networks:
      - wpsite
  # phpmyadmin
  phpmyadmin:
    depends_on:
      - wordpress_db
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - '8080:80' #public-port/docker-port
    environment:
      PMA_HOST: wordpress_db
      MYSQL_ROOT_PASSWORD: password 
    networks:
      - wpsite
  # Wordpress
  wordpress:
    depends_on:
      - wordpress_db
    image: wordpress:latest
    ports:
      - '8000:80'
    restart: always
    volumes: ['./:/var/www/html']
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
    networks:
      - wpsite
networks:
  wpsite:
volumes:
  db_data:

docker-machine ls返回:

NAME      ACTIVE   DRIVER       STATE     URL                        
default   *        virtualbox   Running   tcp://192.168.99.100:2376           v18.09.2

尝试连接到192.168.99.100:80(在其中显示wordpress的地方)时,我无法连接。当我连接到192.168.99.100:2376时,我可以连接,但是页面上显示的只是垃圾字符。 Junk characters on screen。 任何想法如何解决这个问题?

0 个答案:

没有答案