The docker environment for developing Blackbird Chess
Go to file
Mahmoud Zalt cd3fd53338 add the docker hub url of (laradock) to the readme file 2015-08-22 13:11:10 +03:00
docker update images names 2015-08-21 22:53:35 +03:00
laravel add .env.docker file to be edited by the user to get a pre configured app 2015-08-22 13:03:05 +03:00
LICENSE add License file 2015-08-21 22:12:06 +03:00
README.md add the docker hub url of (laradock) to the readme file 2015-08-22 13:11:10 +03:00

README.md

LaraDock

forthebadge

What is this?

LaraDock is a starter project to get you up and running with Laravel 5 and Docker.

It includes a Laravel v5.1.10 fresh installation and a pre-configured Docker Compose file (containg most required images to run a Laravel application).

What is Docker?

Docker is a Linux container, written in Go and based on LXC and AUFS.

What is Laravel?

Are you serious!!

Why Docker not Vagrant?!

Vagrant gives you Virtual Machines in minutes while Docker gives you Linux Containers in seconds.

Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you lightweight Virtual Containers, that share the same kernel and allow to safely execute independent processes.

What's next?

LaraDock strives to make the development experience easier. And it is inspired by Laravel Homestead.

In the near future LaraDock will become a stand-alone package that manages your Docker Virtual Containers as Homestead does with your Vagrant Virtual Machines.

Questions?

If you have any questions please share it with us on Join the chat at https://gitter.im/LaraDock/laradock or email me on (mahmoud@zalt.me).

Highlights

Included Images:

  • NGINX+PHP
  • MySQL
  • Redis
  • Beanstalked
  • Data Volume (for MySQL & Redis)

Note: PHP and NGINX are in one container, I will split them whenever I see the need for it.

Contents

Requirements

  • Docker toolbox (Download) this includes:
    • VirtualBox
    • Docker Client
    • Docker Machine
    • Docker Compose (Required)
    • Docker Kitematic (Not Important)
  • Git (Download)
  • Composer (Download)

Note: Git & Composer can be installed on Docker Containers if you don't want to install them on your machine. (But you have to do this yourself for now).

Usage

1 - First clone the project

	git clone https://github.com/LaraDock/laradock laradock

2 - Inside laradock there are 2 directories (Laravel and Docker) let's start with Laravel

	cd laradock/laravel

3 - Install the Composer packages

	composer install

4 - On laravel's root directory laradock/laravel, rename the file .env.docker to .env

5 - Provide some permissions (directories should be writable by the web server)

	sudo chmod -R 777 storage && sudo chmod -R 777 bootstrap/cache

6 - Now let's start with the Docker stuff

	cd ../docker

7 - Edit the hosts file on your machine, to map your Docker IP to the laravel.dev domain, example:

	192.168.5x.10x  laravel.dev   # (make sure to set your Docker IP)

8 - Finally run the containers and start coding.

"Note: Only the first you run this command will take up to 7 minutes (depend on your connection speed) to download the images to your local machine, Only once in life.

	docker-compose up -d

9 - Open your browser and visit http://laravel.dev

You should see a page like this:

Documentation

Close all running Containers

docker-compose stop

Delete all existing Containers

docker-compose rm -f

Note: Careful with this command as it will delete your Data Volume Container as well. (if you want to keep your Database data than you should stop each container by itself as follow):

docker stop {container-name}

Delete an Image (remove the unused software)

To delete an image (software), just edit the laradock/docker/docker-compose.yml file.

Example: Assume you want to remove the Beanstalkd Container.

Open the docker-compose.yml file, and comment out the beanstalkd section:

# Beanstalkd Container #-----------------------------------
# beanstalkd:
#  image: laradock/beanstalkd:latest
#  container_name: beanstalkd
#  ports:
#    - "11300:11300"
#  privileged: true

Add an Image (add a software to run with other Containers)

To add an image (software), just edit the laradock/docker/docker-compose.yml and add your container details, to do so you need to be familiar with the docker compose file syntax.

Edit a Container (change Ports or Volumes)

To modify a container you can simply open the laradock/docker/docker-compose.yml and change everything you want.

Example: if you want to set the MySQL port to 3333, just replace the default port with yours:

  ports:
    - "3333:3306"

Edit an existing Image (change some configuration in the image)

To edit an image, and take full control of it:

  1. clone the LaraDock docker-images repository https://github.com/LaraDock/docker-images
  2. modify whichever Dockfile you want
  3. from the modified image directory run docker build -t {your-image-name} .

All the images are open source and hosted on the Docker Hub.

If you find any bug or you have and suggestion that can improve the performance of any image, please consider contributing. Thanks in advance.

View the Log files

The Log files are stored in the laradock/docker/logs directory.

Contributing

All contributions are welcomed.

Support

Issues on Github.

Credits

Mahmoud Zalt

License

MIT License (MIT)