Code Monkey home page Code Monkey logo

homestead-docker's Introduction

Laravel homestead-docker

Create a homestead docker container for your development env. ( files taken from laravel settler: provision.sh (modified) + serve.sh )

Install docker && docker compose

please refer to these tutorials:

curl -sSL https://get.docker.com/ | sh
curl -L https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

Pull homestead image

docker pull shincoder/homestead:php7.0

Clone && Edit docker-compose.yml

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.

Start your containers

There are only two containers to run. web container ( includes everything except your database ), and mariadb container.

sudo docker-compose up -d

SSH into the container (password: secret):

ssh -p 2222 homestead@localhost

Add a virtual host

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

That's it

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.

Notes

  • 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.

homestead-docker's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.