Run existing Wordpress site using Docker -
i want run existing wordpress site on docker local development.
this docker-compose file:
version: '2' services: mysql: image: mysql:5.7 volumes: - "./.data/db:/var/lib/mysql" ports: - "9306:3306" restart: environment: mysql_root_password: example_password mysql_database: example_database_name wordpress: image: wordpress volumes: - "./:/var/www/html" links: - mysql ports: - "80:80" restart: environment: wordpress_db_password: example_password wordpress_db_name: example_database_name
however, problem have offical wordpress docker image insists on installing wordpress. fine if don't have wordpress installed, causes lot of problems if have installed. frustrating because organised folders internal wordpress files in separate folder called "wp", "wp-content" on separate directory.
so question how can run existing wordpress site using docker.
your best bet if want use official image going to mount wp-content
directory not entire www
directory, like:
-v /path/to/my/blog/wp-content:/var/www/html/wp-content
and adjust custom set-up have involving "wp" directory. wordpress expects directory structure, depending on why broke out files may or may not able use default container. nice thing using way can update wp updating container , files remain protected.
if needs custom that, mentioned, can try using wp dockerfile , edit suit needs, if can use standard wp-content
structure, it's going make things simpler manage , maintain.
Comments
Post a Comment