简体   繁体   English

使用Docker安装Wordpress本地站点

[英]Install wordpress local site with Docker

I downloaded a github folder with a wordpress site, after the unzip the weight of it is about 1,8 gb. 我下载了一个带有wordpress网站的github文件夹,解压缩后的重量约为1.8 gb。 Inside the master folder I've 9 folders, two of them named: 1: wp-content 2: wp-includes 在主文件夹中,我有9个文件夹,其中两个名为:1:wp-content 2:wp-includes

I already created the docker-compose.yml file and the code inside it is this: 我已经创建了docker-compose.yml文件,其中的代码是这样的:

version: '3'

services:
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  wordpress:
    depends_on:
      - db
    image: wordpress:5.1.1-php7.3-apache
    ports:
      - "8000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
    working_dir: /var/www/html
    volumes:
      - ./wp-content:/var/www/html/wp-content
      - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
volumes:
  db_data: 

The lines up above are necessary only for install wordpress. 上面的行仅对于安装wordpress是必需的。 Now my question is, what could I do to install and launch the complete site that i downloaded ? 现在我的问题是,我该怎么做才能安装并启动我下载的完整网站?

The entire process must be done with docker, install and launch the site. 整个过程必须使用docker完成,安装并启动网站。

Thank you for everything :) 谢谢你为我做的一切 :)

Ensure you have the volume mount points which contains the existing app source code and the db files and the script to do db update. 确保您具有包含现有应用程序源代码和db文件以及执行db更新的脚本的卷安装点。 wordpress section in docker-compose docker-compose中的wordpress部分

   volumes:
      - ./codeblog.dotsandbrackets.com:/var/www/html

mysql section in docker-compose docker-compose中的mysql部分

volumes:
  - ./codeblog.dotsandbrackets.com.20170808-024302.sql.gz:/docker-entrypoint-initdb.d/backup.sql.gz
  - ./migrate.sql:/docker-entrypoint-initdb.d/migrate.sql

This example uses nginx webserver Ref : https://codeblog.dotsandbrackets.com/migrate-wordpress-docker/ 此示例使用nginx Web服务器Ref: https : //codeblog.dotsandbrackets.com/migrate-wordpress-docker/

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

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