简体   繁体   中英

Restore a WordPress site on Docker.

I have a website which i want to containerised i tried following the steps mentioned on this link
i have my files copied to /var/www/html/example.com/src/ and also my docker-compose file looks like this:

version: '2'

services:
  example_db:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: ${WP_DB_USER_PASSWORD}
      MYSQL_DATABASE: ${WP_DB_NAME}
    volumes:
      - /var/lib/mysql:/docker-entrypoint-initdb.d/example.sql
    container_name: example_db


    restart: always

  example:
    depends_on:
      - example_db
    image: wordpress:5.0.0-php5.6-apache # we're using the image with php7.1 
    environment:
      WORDPRESS_DB_PASSWORD: ${WP_DB_USER_PASSWORD}
      WORDPRESS_DB_NAME: ${WP_DB_NAME}
    container_name: example
    ports:
      - "1512:80"
    restart: always
    links:
      - example_db:mysql
    volumes:
      - ./src:/var/www/html/docker/example.com/src/

i have my wordpress file in /www/html/docker/example.com/src/ and the db backup inside /src/docker/example.com/data/docker-entrypoint-initdb.d/lbdocker.sql

every time i acces the website it goes to the WordPress setup guide.

this is old but the issue is related to the $table_prefix

Your backup table prefix is different than the destination.

Update your config and it will work. Fix

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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