This project will drop in to an existing project and run it within Docker. It comes with the latest version of PHP-FPM, Nginx, MariaDB, Beanstalk, Redis and Mailhog for when you're using it in local development.
Clone this repository and run docker-compose up
then point your browser at
http://localhost:8080
and you should see a beautiful PHP info page.
Clone this repository to your local machine. Copy the docker-compose.yml
file and .docker
directory into your project directory. Then run
docker-compose up
and you'll be off and running.
Clone this repository, sit around for 26 seconds then do the step above.
The default root password is vagrant
and the default database name is vagrant
,
both of these should be changed to suit your project. The data will be persisted
across containers being created/destroyed in the .docker/volumes/mysql
directory on your local machine (or server you deploy to).
You can overwrite the Nginx website config by editing the file that is located at
.docker/config/nginx.conf
which will be picked up on starting the container.
The included version of PHP-FPM includes GD, Intl and BZ2 extensions as well as Composer being installed as well.
You can access the services Nginx, MariaDB, Mailhog and Beanstalkd Console at:
- Nginx - http://localhost:8080
- mailhog - http://localhost:8081
- Beanstalkd Console - http://localhost:8082
- MariaDB - tcp://localhost:3306 (Use Sequel Pro on a Mac)
When configuring your environment to connect to each service, you can use the following hostnames and ports:
mariadb
- 3306beanstalkd
- 11300redis
- 6739mailhog
- 1025
If you're running something like Laravel and need to run php artisan migrate
, you can
do this by running:
docker-compose exec php bash
within the project directory, this will give you a bash prompt that you can then cd /www
and run php artisan migrate
and it'll run the migrations.
It'll be wise to add the following into your .gitignore
file to stop the
MariaDB databases being added to your repo:
.docker/volumes/mysql/*
!.docker/volumes/mysql/.gitkeep
This project is licensed under an Apache 2.0 license which you can find within this repository in the LICENSE file.
If you have any feedback, comments or suggestions, please feel free to open an issue within the repository on Github.