Build a Docker image that contains the environment for IDP study.
Currently, it has the followings LAMP stack in services, and will automatically implement the download repo into the environment.
- php:7.3-apache (with pdo extention installed)
- mariadb:10.3
- MailHog
Currently, it's just an beta version, once the image be uploaded to docker hub, the installation will be updated
- Clone the repo
git clone [email protected]:spiderPan/docker-idp.git
- Clone the target repo into the volume
cd docker-idp cd ./web git clone https://github.com/spiderPan/Fanshawe-IDP-Moive-Review.git ./www
- Make sure the target repo has database in "db" folder, if not please update
docker-compose.yml
file inmysql
service'svolume
section. - Make sure the target rep has code the conditionally loading database host, it should looks like
if(getenv('STAGE')==='LOCAL'){ $this->host='mysql'; }
- Running the container based on the build image
cd ../ docker-compose up
- In case you need to re-initialize the container, please clean the volume by doing
or
docker-compose down docker volume prune
docker volume ls docker volume rm NAME
-
Once the container is ready, go to http://localhost:8080, you should see the site is up to go.
-
Checking the current container ID by running
docker ps
-
Use the
CONTAINER ID
Column to replace the placeholderCONTAINERID
in followingdocker exec -t -i CONTAINERID /bin/bash
-
Any
mail()
function will trigger email to MailHog, where can be checked inhttp://localhost:8025/
The project can be improved by the following fields
- Implement PHP application from gitrepo to the container
- Run testing cases.