I have just started playing around with WordPress and I have a few questions:
- I would like to track my changes using Git. As far as I have researched, I should track only: 'wp-config.php' and 'wp-content' directory. Is there another way of tracking changes on a WP project?
- Everytime I clone the project, it greets me with the setup phase. I noticed that the changes are not really saved, i.e. deleting a plugin or creating a page. After looking in the database I noticed that WP stores pages and more info inside the database. How could I track this kind of changes?
Notes: I have created a development environment using Docker & Docker-Composer as follows. I would like to add pages and make configuration and then upload the changes to the git repository. The only problem is that WP saves the changes to the database. How should I handle this?
version: '3'
services:
mysql:
image: mysql:8
container_name: "MySQL-Database"
restart: always
command: "--default-authentication-plugin=mysql_native_password"
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
volumes:
- ./mysql_data:/var/lib/mysql
excelsior:
build: ./excelsior-app/
container_name: "Wordpress-Server"
depends_on:
- mysql
restart: always
volumes:
- ./excelsior-app/wp-content:/var/www/html/wp-content
environment:
WORDPRESS_DB_HOST: mysql
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
ports:
- 8080:80
- 443:443
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: "PHP-MyAdmin"
depends_on:
- mysql
restart: always
ports:
- 3333:80
environment:
PMA_HOST: mysql
MYSQL_ROOT_PASSWORT: wordpress
'excelsior' as follows:
FROM wordpress
COPY wp-config.php /var/www/html/