Example of a PHP/Apache site running in Docker, ready to pushed to Elastic Beanstalk.
- clone the repo
- run
composer install(if applicable) - run
npm install - run
npm run docker:upto launch the development container - you should now be able to view the site at http://localhost
- to run on a different port, run
PORT=7000 npm run docker:up - to launch a terminal shell, run
npm run docker:shellwhile the container is running - to launch the production container, run
npm run docker:prod
npm run docker:listto see current containersnpm run docker:killto stop and destroy current containersnpm run docker:imgto see current imagesnpm run docker:clearto delete all images
Also included are example Docker Compose YAML files and dc: tasks which can be used as an alternative approach.
A set of simple tests powered by Mocha and Unit.js checks to see if the site is running, with these tasks:
npm run testto check your local dev site at http://localhost:8000 (use thePORTenv to override)npm run test:stagingto check the EB staging urlnpm run test:prodto check the production site
- The dev container is based on the
webdevops/php-apacheimage, configuration info here - AWS EB Resources
- EB Docker config