This is a sample website built on Docker containers with PHP, CSS, HTML, and a MySQL database backend!
I started this out as a project that would be hosted in AWS that featured a full CI/CD pipeline, ECS, and more.
Only so much you can do in a time crunch, I suppose.
Anyway, install the dependencies, then scoot down to Instructions for Creating the Website Locally
.
- Ensure Docker Desktop is installed, and started. (https://www.docker.com/products/docker-desktop/)
- Alternatively, just make sure Docker and Docker Compose are installed. ()
- Ensure MySQLWorkbench is installed, and started. (https://www.mysql.com/products/workbench/)
- Ensure Git is installed on your local machine: (https://git-scm.com/downloads)
As mentioned previously, the original intent of this project was to spin up the Docker instances in the cloud.
Since I was not able to complete this objective, here are the instructions on creating the PHP website and MySQL database locally as a proof-of-concept:
- Clone this repository to your local machine:
git clone https://github.com/binbashburns/busybeecoffee-local.git
- Move into the directory:
cd busybeecoffee-local
- Build the Docker container images:
docker-compose up --detach
- Access http://localhost/ in a web browser.
- Once you're done browsing the website, tear everything doWn:
docker-compose down
- A MySQL 8.0 container will be spun up as a database backend for the PHP/HTML/Apache web application.
- The default credentials for the database are defined in
docker-compose.yml
. You can modify them however you would like, but the default credentials are as follows: - Root Account:
root
- Root Account Password:
super-secret-password
- Database Name:
busybee-db
A few diagrams have been created to accompany this project, and are located in the diagrams
directory of this GitHub repository:
busybee-erd.pdf
: Database Entity Relationship Diagrambusybee-app-logic.pdf
: A simple diagram showing the two Docker containers and the application logic from Web Browser to the database.
- PHP-Apache Docker Container for hosting and running the website
- MySQL Docker Container for the database backend that the website interacts with
PHP, MySQL, & JavaScript Book: https://www.oreilly.com/library/view/learning-php-mysql/9781491979075/
Website Template: https://htmlcodex.com/
Embedded PHP/MySQL Queries: https://www.mysqltutorial.org/php-querying-data-from-mysql-table/
More than Certified in Docker: https://morethancertified.com/course-resources/more-than-certified-in-docker/