Default configuration for WordPress Docker Container -
i'm working on project using wordpress api.
this docker-compose.yml file:
version: '3.1' services: wordpress: image: wordpress volumes: - ./volumes/wordpress/:/var/www/html ports: - 8080:80 environment: wordpress_db_password: root depends_on: - mysql mysql: image: mysql:5.7 volumes: - ./volumes/mysql/:/var/lib/mysql environment: mysql_root_password: root web: build: context: . dockerfile: dockerfile volumes: - ./src/:/src ports: - 8081:8081 depends_on: - wordpress
in order use wordpress api, need configure wordpress container manually going http://localhost:8080/wp-admin
, changing settings.
thing is, need make settings changes automatic because everytime remove volume
folder in order reset wordpress content, removes settings.
any idea on how can achieve this?
i guess settings configured via wp-admin section stored in database.
if that's case can this:
- setup first wordpress instance running docker-compose , completing setup steps.
- stop compose. @ point in mysql volume folder have database structure configured wordpress in it.
- store contents of folder somewhere.
now, if want create wordpress instance, can edit docker-compose.yml file in order adjust volume binding , make sure initial content of mysql volume contains data got step 3 above.
when start new docker-compose stack it'll start populated database , should have preconfigured wordpress instance.
wiki
Comments
Post a Comment