I’m running the latest version Docker on WSL2 in Windows 10.
What my goal is to copy my inmotionhosting website to my home computer into a docker container. Then copy the wordpress, import the database. My goal is to run the “production” wordpress in Docker.
I’ve found tons of help creating wordpress, mysql, phpmyadmin containers. Using suggested docker-compose .yml I can get to wordpress, mysql and phpmyadmin. But have no clue how to use my copied wordpress files.
One big problem is the directory structure of my hosting service is different from my wsl system. Watching the compose file start up. I see it’s referencing /var/www/html. Doesn’t exit. I created and my files there. Apparently is was ignored. My docker-compose files is below. The result form this is results in complaints about unable to read .htaccess.
I’ve tried many suggestions from google, none worked.
Is there a guide I can follow to help me?
Thanks so much.
version: ‘3’
services:
Database
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
networks:
- wpsite
phpmyadmin
phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
restart: always
ports:
- ‘8080:80’
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: password
networks:
- wpsite
Wordpress
wordpress:
depends_on:
- 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: