Create a homestead docker container for your development env. ( files taken from laravel settler: provision.sh (modified) + serve.sh )
please refer to these tutorials:
- install docker (https://docs.docker.com/installation/ubuntulinux/)
curl -sSL https://get.docker.com/ | sh
- install docker compose (https://docs.docker.com/compose/install/)
curl -L https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
https://download.docker.com/mac/stable/Docker.dmg
docker pull shincoder/homestead:php7.0
git clone https://github.com/shincoder/homestead-docker.git
rename docker-compose.dist.yml
to docker-compose.yml
then edit the file with you own
paths and ports.
There are only two containers to run. web container ( includes everything except your database ), and mariadb container.
sudo docker-compose up -d
ssh -p 2222 homestead@localhost
Assuming you mapped your apps folder to /apps
(you can change mappings in the docker-compose.yml file,
it's prefered to use absolute paths), you can do:
cd / && ./serve.sh myapp.dev /apps/myapp/public
In the host, update /etc/hosts
to include your app domain:
127.0.0.1 myapp.dev
Our web container starts nginx, php-fpm, redis, beanstalk. and has gruntjs, gulp, bower...etc some relevant ports have been added to docker-compose.yml ( livereload standard port, karma server port ), change them if you need to.
- Integrating Xdebug for debugging
- Integrate mailcatcher to get all email output
- Move the apps folder to /var/www/apps
- Move the apps/volumes folder to /etc
- Send me an email to [email protected] or fork this package
- Use docker's local IP address to connect to your database. Run
docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CID}
, where${CID}
is docker container ID of the database - Databases: by default mariadb is used as a database, but you are free to use any database you want: choose from these excellent images by Tutum: tutum/mysql or tutum/postgresql, they expose different environment variables, so don't forget to update your docker-compose file accordingly.