A pretty simplified Docker Compose workflow that sets up a LAMP stack for Wordpress Development.
To get started, make sure you have Docker installed on your system:
Next, clone this repository!. Then, navigate in your terminal to the directory you cloned this repo, and spin up the containers for the web server by running:
docker-compose up --build -dThe following are built for our web server, with their exposed ports detailed:
- WP -
:80 - MYSQL -
:3306 - ADMINER -
:8080 - MAILHOG -
:8025
By default, whenever you bring down the Docker network, your MySQL data will be removed after the containers are destroyed. If you would like to have persistent data that remains after bringing containers down and back up, do the following:
- Create a
db_datafolder in the project root. - Under the
dbservice in yourdocker-compose.ymlfile, add the following lines:
volumes:
- ./db_data:/var/lib/mysql
and then list all volumes under:
networks:...
services: ...
# This line
volumes:
db_data:
In case if you want persistent the data but not storing it inside mysql folder, change above line to:
volumes:
- db_data:/var/lib/mysql
The WORDOC uses MailHog as the default application for testing email sending and general SMTP work during local development. Using the provided Docker Hub image, getting an instance set up and ready is simple and straight-forward. The service is included in the docker-compose.yml file, and spins up alongside the webserver and database services.
To see the dashboard and view any emails coming through the system, visit localhost:8025.