Commit bf691337 authored by Luciano Jr's avatar Luciano Jr Committed by GitHub

Merge pull request #20 from laradock/master

Just update the fork
parents d6165452 bf4a5beb
......@@ -9,4 +9,4 @@ charset = utf-8
[{Dockerfile,docker-compose.yml}]
indent_style = space
indent_size = 4
indent_size = 2
COMPOSE_CONVERT_WINDOWS_PATHS=1
### Info:
- Docker version (`$ docker --version`):
- Laradock commit (`$ git rev-parse HEAD`):
- System info (Mac, PC, Linux):
- System info disto/version:
### Issue:
##### What seems to be going wrong?
_____
### Expected behavior:
##### What should be happening instead?
_____
### Reproduce:
##### How might we be able to reproduce the error?
_____
### Relevant Code:
```
// place code here
```
.idea
/logs
/data
.env
/.project
\ No newline at end of file
language: bash
sudo: required
services:
- docker
env:
matrix:
- PHP_VERSION=56 BUILD_SERVICE="applications blackfire minio percona nginx caddy apache2 mysql mariadb phpmyadmin postgres postgres-postgis pgadmin neo4j mongo redis"
- PHP_VERSION=70 BUILD_SERVICE="applications blackfire minio percona nginx caddy apache2 mysql mariadb phpmyadmin postgres postgres-postgis pgadmin neo4j mongo redis"
- PHP_VERSION=71 BUILD_SERVICE="applications blackfire minio percona nginx caddy apache2 mysql mariadb phpmyadmin postgres postgres-postgis pgadmin neo4j mongo redis"
- PHP_VERSION=56 BUILD_SERVICE=workspace
- PHP_VERSION=70 BUILD_SERVICE=workspace
- PHP_VERSION=71 BUILD_SERVICE=workspace
- PHP_VERSION=56 BUILD_SERVICE=php-fpm
- PHP_VERSION=70 BUILD_SERVICE=php-fpm
- PHP_VERSION=71 BUILD_SERVICE=php-fpm
- PHP_VERSION=56 BUILD_SERVICE="php-worker hhvm"
- PHP_VERSION=70 BUILD_SERVICE="php-worker hhvm"
- PHP_VERSION=71 BUILD_SERVICE="php-worker hhvm"
- PHP_VERSION=56 BUILD_SERVICE=mssql
- PHP_VERSION=70 BUILD_SERVICE=mssql
- PHP_VERSION=71 BUILD_SERVICE=mssql
- PHP_VERSION=56 BUILD_SERVICE=rethinkdb
- PHP_VERSION=70 BUILD_SERVICE=rethinkdb
- PHP_VERSION=71 BUILD_SERVICE=rethinkdb
- PHP_VERSION=56 BUILD_SERVICE=aerospike
- PHP_VERSION=70 BUILD_SERVICE=aerospike
- PHP_VERSION=71 BUILD_SERVICE=aerospike
- PHP_VERSION=56 BUILD_SERVICE="memcached beanstalkd beanstalkd-console rabbitmq adminer elasticsearch certbot mailhog selenium jenkins proxy proxy2 balancer"
- PHP_VERSION=70 BUILD_SERVICE="memcached beanstalkd beanstalkd-console rabbitmq adminer elasticsearch certbot mailhog selenium jenkins proxy proxy2 balancer"
- PHP_VERSION=71 BUILD_SERVICE="memcached beanstalkd beanstalkd-console rabbitmq adminer elasticsearch certbot mailhog selenium jenkins proxy proxy2 balancer"
- HUGO_VERSION=0.20.2
# Installing a newer Docker version
before_install:
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-engine
script: ./travis-build.sh
deploy:
provider: pages
skip_cleanup: true
local_dir: docs
github_token: $GITHUB_TOKEN
on:
branch: master
condition: -n "${HUGO_VERSION}"
notifications:
email: false
baseurl = "http://laradock.io/"
languageCode = "en-us"
publishDir = "../"
publishDir = "../docs"
title = "Laradock"
theme = "hugo-material-docs"
metadataformat = "yaml"
canonifyurls = true
uglyurls = true
# Enable Google Analytics by entering your tracking id
googleAnalytics = "UA-37514928-9"
[params]
# General information
author = "Mahmoud Zalt"
description = "Laradock documentations."
description = "Full PHP development environment for Docker."
copyright = ""
# Repository
......@@ -19,7 +20,7 @@ googleAnalytics = "UA-37514928-9"
repo_url = ""
version = ""
logo = ""
logo = "images/logo.png"
favicon = ""
permalink = "#"
......@@ -62,8 +63,8 @@ googleAnalytics = "UA-37514928-9"
weight = 3
[[menu.main]]
name = "Related Projects"
url = "related-projects/"
name = "Guides"
url = "guides/"
weight = 4
[[menu.main]]
......@@ -71,15 +72,20 @@ googleAnalytics = "UA-37514928-9"
url = "help/"
weight = 5
[[menu.main]]
name = "Related Projects"
url = "related-projects/"
weight = 6
[[menu.main]]
name = "Contributing"
url = "contributing/"
weight = 6
weight = 7
[[menu.main]]
name = "License"
url = "license/"
weight = 7
weight = 8
# ------- MENU END -----------------------------------------
......
---
title: Contributing
type: index
weight: 6
weight: 7
---
Your contribution is more than welcome.
## Have a Question
## Got a Question or Problem?
If you have questions about how to use Laradock, please direct your questions to the discussion on [Gitter](https://gitter.im/Laradock/laradock). If you believe your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as `Question`) And you can still seek help on Gitter for it.
If you have questions about how to use LaraDock, please direct your questions to the discussion on [Gitter](https://gitter.im/LaraDock/laradock). If you believe your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Question).
## Found an Issue?
If you find a bug in the source code or a mistake in the documentation, you can help us by
submitting an [Issue](https://github.com/laradock/laradock/issues). Even better you can submit a Pull Request with a fix.
## Want a Feature?
You can request a new feature by submitting an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.
## Found an Issue
If have an issue or you found a typo in the documentation, you can help us by
opnening an [Issue](https://github.com/laradock/laradock/issues).
## Update Documentation (Site)
**Steps to do before opening an Issue:**
1. Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).
2. Decide if the Issue belongs to this project or to [Docker](https://github.com/docker) itself! or even the tool you are using such as Nginx or MongoDB...
If your issue appears to be a bug, and hasn't been reported, then open a new issue.
*This Help us to maximize the effort we can spend fixing issues and adding new
features, by not reporting duplicate issues.*
## Want a Feature
You can request a new feature by submitting an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as `Feature Suggestion`). If you would like to implement a new feature then consider submitting a Pull Request yourself.
## Update the Documentation (Site)
Laradock uses [Hugo](https://gohugo.io/) as website generator tool, with the [Material Docs theme](http://themes.gohugo.io/theme/material-docs/). You might need to check their docs quickly.
Go the `DOCUMENTATION/content` and search for the markdown file you want to edit
1. Install [Hugo](https://gohugo.io/) on your machine.
2. Clone laradock.
3. Go to `/docs`.
4. Delete everything except the `_settings` folder & the `CNAME` file.
5. Open `docs/_settings` from your terminal and run `hugo serve` to host the website locally.
6. Open the `docs/_settings/content` and search for the folder of the section you want to edit.
7. In each section there's an `index.md` file, that's the file you need to edit.
8. To edit the sidebar (in case you are adding new section) go to `docs/_settings/config.toml` and add the section there.
9. After done editing, run the this command `hugo` to generate the updated site inside the `docs` folder.
10. Go back to the project root directory, commit and push..
Note: Every folder represents a section in the sidebar "Menu". And every page and sidebar has a `weight` number to show it's position in the site.
To update the sidebar or add a new section to it, you can edit this `DOCUMENTATION/config.toml` toml file.
> The site will be auto-generated in the `docs/` folder by [Travis CI](https://travis-ci.org/laradock/laradock/).
## Coding Guidelines
### Host the documentation locally
1. Install [Hugo](https://gohugo.io/) on your machine.
2. Edit the `DOCUMENTATION/content`.
3. Delete the `/docs` folder from the root.
4. After you finish the editing, go to `DOCUMENTATION/` and run the `hugo` command to generate the HTML docs (inside a new `/docs` folder).
## Support new Software
* Create folder with the software name.
* Add a `Dockerfile`, write your code there.
## Support new Software (Add new Container)
* You may add additional files in the software folder.
* Forke the repo and clone the code.
* Create folder as the software name (example: `mysql` - `nginx`).
* Add your `Dockerfile` in the folder "you may add additional files as well".
* Add the software to the `docker-compose.yml` file.
* Make sure you follow our commenting style.
* Make sure you follow the same code/comments style.
* Add the environment variables to the `env-example` if you have any.
* **MOST IMPORTANTLY** updated the `Documentation`, add as much information.
* Submit a Pull Request, to the `master` branch.
## Edit supported Software (Edit a Container)
* Add the software in the `Readme`.
* Forke the repo and clone the code.
## Edit existing Software
* Open the software (container) folder (example: `mysql` - `nginx`).
* Open the software (container) folder.
* Edit the files.
* Edit the files you want to update.
* Make sure to update the `Documentation` in case you made any changes.
* **Note:** If you want to edit the base image of the `Workspace` or the `php-fpm` Containers,
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.
* Submit a Pull Request, to the `master` branch.
* Make sure to update the `Readme` in case you made any changes.
## Issue/PR Submission Guidelines
## Submitting an Issue
Before you submit your issue search the archive, maybe your question was already answered.
If your issue appears to be a bug, and hasn't been reported, open a new issue.
Help us to maximize the effort we can spend fixing issues and adding new
features, by not reporting duplicate issues.
## Edit Base Image
* Open any dockerfile, copy the base image name (example: `FROM phusion/baseimage:latest`).
## Before Submitting a Pull Request (PR)
* Search for the image in the [Docker Hub](https://hub.docker.com/search/) and find the source..
*Most of the image in Laradock are offical images, these projects live in other repositories and maintainer by other orgnizations.*
**Note:** Laradock has two base images for (`Workspace` and `php-fpm`, mainly made to speed up the build time on your machine.
* Find the dockerfiles, edit them and submit a Pull Request.
* When updating a Laradock base image (`Workspace` or `php-fpm`), ask a project maintainer "Admin" to build a new image after your PR is merged.
**Note:** after the base image is updated, every dockerfile that uses that image, needs to update his base image tag to get the updated code.
<br>
## Submit Pull Request Instructions
### 1. Before Submitting a Pull Request (PR)
Always Test everything and make sure its working:
......@@ -86,13 +134,13 @@ Always Test everything and make sure its working:
- Test running the container with some other containers in real app and see of everything is working fine.
- Now edit the container (edit section by section and test rebuilding the container after every edited section)
- Testing building the container (docker-compose build container-name) with no errors.
- Test it in real App.
- Test it in a real App if possible.
## Submitting a PR
### 2. Submitting a PR
Consider the following guidelines:
* Search [GitHub](https://github.com/laradock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort.
* Search [GitHub](https://github.com/laradock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate efforts.
* Make your changes in a new git branch:
......@@ -123,14 +171,9 @@ git push origin my-fix-branch -f
*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.*
### 3. After your PR is merged
## After your PR is merged
After your pull request is merged, you can safely delete your branch and pull the changes
from the main (upstream) repository:
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
......@@ -161,4 +204,4 @@ from the main (upstream) repository:
<br>
## Happy Coding :)
#### Happy Coding :)
---
title: Getting Started
type: index
weight: 2
---
## Requirements
- [Git](https://git-scm.com/downloads)
- [Docker](https://www.docker.com/products/docker/) `>= 1.12`
## Installation
Choose the setup the best suits your needs.
- [A) Setup for Single Project](#A)
- [A.1) Already have a PHP project](#A1)
- [A.2) Don't have a PHP project yet](#A2)
- [B) Setup for Multiple Projects](#B)
<a name="A"></a>
### A) Setup for Single Project
> (Follow these steps if you want a separate Docker environment for each project)
<a name="A1"></a>
### A.1) Already have a PHP project:
1 - Clone laradock on your project root directory:
```bash
git submodule add https://github.com/Laradock/laradock.git
```
Note: If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `.
*To keep track of your Laradock changes, between your projects and also keep Laradock updated [check these docs](/documentation/#keep-track-of-your-laradock-changes)*
Your folder structure should look like this:
```
+ project-a
+ laradock-a
+ project-b
+ laradock-b
```
*(It's important to rename the laradock folders to unique name in each project, if you want to run laradock per project).*
> **Now jump to the [Usage](#Usage) section.**
<a name="A2"></a>
### A.2) Don't have a PHP project yet:
1 - Clone this repository anywhere on your machine:
```bash
git clone https://github.com/laradock/laradock.git
```
Your folder structure should look like this:
```
+ laradock
+ project-z
```
2 - Edit your web server sites configuration.
We'll need to do step 1 of the [Usage](#Usage) section now to make this happen.
```
cp env-example .env
```
At the top, change the `APPLICATION` variable to your project path.
```
APPLICATION=../project-z/
```
Make sure to replace `project-z` with your project folder name.
> **Now jump to the [Usage](#Usage) section.**
<a name="B"></a>
### B) Setup for Multiple Projects:
> (Follow these steps if you want a single Docker environment for all your project)
1 - Clone this repository anywhere on your machine (similar to [Steps A.2. from above](#A2)):
```bash
git clone https://github.com/laradock/laradock.git
```
Your folder structure should look like this:
```
+ laradock
+ project-1
+ project-2
```
2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains.
Laradock by default includes `project-1.conf` and `project-2.conf` as working samples.
3 - change the default names `project-n`:
You can rename the config files, project folders and domains as you like, just make sure the `root` in the config files, is pointing to the correct project folder name.
4 - Add the domains to the **hosts** files.
```
127.0.0.1 project-1.dev
127.0.0.1 project-2.dev
```
> **Now jump to the [Usage](#Usage) section.**
<a name="Usage"></a>
## Usage
**Read Before starting:**
If you are using **Docker Toolbox** (VM), do one of the following:
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](/documentation/#upgrading-laradock)
- Use Laradock v3.\*. Visit the [Laradock-ToolBox](https://github.com/laradock/laradock/tree/Laradock-ToolBox) branch. *(outdated)*
<br>
We recommend using a Docker version which is newer than 1.13.
<br>
>**Warning:** If you used an older version of Laradock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent as much errors as possible.
<br>
1 - Enter the laradock folder and copy `env-example` to `.env`
```shell
cp env-example .env
```
You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used.
2 - Build the enviroment and run it using `docker-compose`
In this example we'll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:
```bash
docker-compose up -d nginx mysql
```
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
You can select your own combination of containers form [this list](http://laradock.io/introduction/#supported-software-images).
*(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers).*
<br>
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...)
```bash
docker-compose exec workspace bash
```
*Alternatively, for Windows PowerShell users: execute the following command to enter any running container:*
```bash
docker exec -it {workspace-container-id} bash
```
**Note:** You can add `--user=laradock` to have files created as your host's user. Example:
```shell
docker-compose exec --user=laradock workspace bash
```
*You can change the PUID (User id) and PGID (group id) variables from the `.env` file)*
<br>
4 - Update your project configurations to use the database host
Open your PHP project's `.env` file or whichever configuration file you are reading from, and set the database host `DB_HOST` to `mysql`:
```env
DB_HOST=mysql
```
*If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
<br>
5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`.
......@@ -4,6 +4,6 @@ type: index
weight: 5
---
Join the chat room on [Gitter](https://gitter.im/LaraDock/laradock) and get help and support from the community.
Join the chat room on [Gitter](https://gitter.im/Laradock/laradock) and get help and support from the community.
You can as well can open an [issue](https://github.com/laradock/laradock/issues) on Github (will be labeled as Question) and discuss it with people on [Gitter](https://gitter.im/LaraDock/laradock).
You can as well can open an [issue](https://github.com/laradock/laradock/issues) on Github (will be labeled as Question) and discuss it with people on [Gitter](https://gitter.im/Laradock/laradock).
---
title: License
type: index
weight: 7
weight: 8
---
[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT)
---
title: Related Projects
type: index
weight: 4
weight: 6
---
LaraDock related projects:
Laradock related projects:
* [LaraDock CLI](https://github.com/lorinlee/laradock-cli) by [LorinLee](https://github.com/lorinlee)
* [LaraDock Env](https://github.com/bagart/laradock_env) by [BAGArt](https://github.com/bagart)
* [Laradock CLI](https://github.com/lorinlee/laradock-cli) by [LorinLee](https://github.com/lorinlee)
* [Laradock Env](https://github.com/bagart/laradock_env) by [BAGArt](https://github.com/bagart)
* [Klaradock](https://github.com/poyhsiao/Klaradock) by [Kim Hsiao](https://github.com/poyhsiao)
* [Ansible Laradock Kubernetes](https://github.com/sifat-rahim/ansible-laradock-kubernetes) by [Sifat Rahim](https://github.com/sifat-rahim)
These Docker Compose projects have piqued our interest:
......
<nav aria-label="Navigation">
<!--<a href="{{ with .Site.Params.repo_url }}{{ . }}{{ else }}{{ .Site.BaseURL }}{{ end }}" class="project">-->
<!--<div class="banner">-->
<!--{{ with .Site.Params.logo }}-->
<!--<div class="logo">-->
<!--<img src="{{ $.Site.BaseURL }}{{ . }}">-->
<!--</div>-->
<!--{{ end }}-->
<a href="{{ with .Site.Params.repo_url }}{{ . }}{{ else }}{{ .Site.BaseURL }}{{ end }}" class="project">
<div class="banner">
{{ with .Site.Params.logo }}
<div class="logo">
<img src="{{ $.Site.BaseURL }}{{ . }}">
</div>
{{ end }}
<!--<div class="name">-->
<!--<strong>{{ .Site.Title }} {{ with .Site.Params.version }}<span class="version">{{ . }}</span>{{ end }}</strong>-->
<!--{{ with .Scratch.Get "repo_id" }}-->
......@@ -13,8 +13,8 @@
<!--{{ . }}-->
<!--{{ end }}-->
<!--</div>-->
<!--</div>-->
<!--</a>-->
</div>
</a>
<div class="scrollable">
<div class="wrapper">
......
......@@ -3,7 +3,7 @@
* theme that is used as fallback in codeblocks
*/
.article pre code {
color: rgba(0, 0, 0, 0.8) !important;
color: rgba(0, 0, 0, 0.78) !important;
}
......@@ -103,3 +103,14 @@ font-style:italic;
.hljs-strong {
font-weight:700;
}
/*
OVERRIDING THE DEFAULT STYLES - By Mahmoud Zalt (mahmoud@zalt.me) for Laradock.io
*/
.project .logo img{
width: 140px;
height: 140px;
background: transparent;
border-radius: 0%;
}
This diff is collapsed.
# Laradock
![](https://s19.postimg.org/jblfytw9f/laradock-logo.jpg)
[![Build Status](https://travis-ci.org/laradock/laradock.svg?branch=master)](https://travis-ci.org/laradock/laradock) [![GitHub issues](https://img.shields.io/github/issues/laradock/laradock.svg)](https://github.com/laradock/laradock/issues) [![GitHub forks](https://img.shields.io/github/forks/laradock/laradock.svg)](https://github.com/laradock/laradock/network) [![GitHub stars](https://img.shields.io/github/stars/laradock/laradock.svg)](https://github.com/laradock/laradock/stargazers) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/laradock/laradock/master/LICENSE)
> Use Docker first and learn about it later.
[![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://zalt.me)
A Docker PHP development environment that facilitates running **PHP** Apps on **Docker**.
Laradock is a Docker PHP development environment that facilitate running **PHP** Apps on **Docker**.
[![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://zalt.me)
## Documentation
......@@ -12,17 +14,18 @@ Laradock is a Docker PHP development environment that facilitate running **PHP**
## Credits
**Super Admins:**
- [Mahmoud Zalt](https://github.com/Mahmoudz) (mahmoudz) [ [Twitter](https://twitter.com/Mahmoud_Zalt) | [Personal Site](http://zalt.me) | [LinkedIn](https://www.linkedin.com/in/mahmoudzalt) ]
- [Bo-Yi Wu](https://github.com/appleboy) (appleboy) [ [Twitter](https://twitter.com/appleboy) ]
- [Philippe Trépanier](https://github.com/philtrep) (philtrep)
- [Mike Erickson](https://github.com/mikeerickson) (mikeerickson)
- Join Us!
**Amazing Contributors:**
- [Contributors](https://github.com/laradock/laradock/graphs/contributors)
**Maintainers:**
- [Mahmoud Zalt](https://github.com/Mahmoudz) @mahmoudz | [Twitter](https://twitter.com/Mahmoud_Zalt) | [Site](http://zalt.me)
- [Bo-Yi Wu](https://github.com/appleboy) @appleboy | [Twitter](https://twitter.com/appleboy)
- [Philippe Trépanier](https://github.com/philtrep) @philtrep
- [Mike Erickson](https://github.com/mikeerickson) @mikeerickson
- [Dwi Fahni Denni](https://github.com/zeroc0d3) @zeroc0d3
- [Thor Erik](https://github.com/thorerik) @thorerik
- [Winfried van Loon](https://github.com/winfried-van-loon) @winfried-van-loon
- [TJ Miller](https://github.com/sixlive) @sixlive
- [Yu-Lung Shao (Allen)](https://github.com/bestlong) @bestlong
- Join Us.
## License
......
#### Install Docker
```
Login Digital Ocean
Add Droplet
1 Click Install docker
Choose Droplet
reset ROOT password
check email
```
#### SSH to your Server
```
ssh root@ipaddress
```
you will be prompt of that password.
type the password you receive in your email
then it will ask to you to change a new password
just change it to the custom root password you want
After SSH
you can check that docker command is working by typing
```
$root@midascode:~# docker
```
#### Set Up Your Laravel Project
```
$root@midascode:~# apt-get install git
$root@midascode:~# git clone https://github.com/laravel/laravel
$root@midascode:~# cd laravel
$root@midascode:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git
$root@midascode:~/laravel/ cd laradock
```
#### Install docker-compose command
```
$root@midascode:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
$root@midascode:~/chmod +x /usr/local/bin/docker-compose
```
#### Create Your LaraDock Containers
```
$root@midascode:~/laravel/laradock# docker-compose up -d nginx mysql
```
#### Go to Your Workspace
```
docker-compose exec workspace bash
```
#### Install laravel Dependencies, Add .env , generate Key and give proper permission certain folder
```
$ root@0e77851d27d3:/var/www# composer install
$ root@0e77851d27d3:/var/www# cp .env.example .env
$ root@0e77851d27d3:/var/www# php artisan key:generate
$ root@0e77851d27d3:/var/www# exit
$root@midascode:~/laravel/laradock# cd ..
$root@midascode:~/laravel# sudo chmod -R 777 storage bootstrap/cache
```
you can then view your laravel site at your ipaddress
for example
```
192.168.1.1
```
You will see there Laravel Default Welcome Page
but if you need to view on your custom domain name
which you would.
#### Using Your Own Domain Name
login to your DNS provider
Godaddy, Namecheap what ever...
And Point the Custom Domain Name Server to
```
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
```
In Your Digital Ocean Account go to
```
https://cloud.digitalocean.com/networking/domains
```
add your domain name and choose the server ip you provision earlier
#### Serve Site With NGINX (HTTP ONLY)
Go back to command line
```
$root@midascode:~/laravel/laradock# cd nginx
$root@midascode:~/laravel/laradock/nginx# vim laravel.conf
```
remove default_server
```
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
```
and add server_name (your custom domain)
```
listen 80;
listen [::]:80 ipv6only=on;
server_name yourdomain.com;
```
#### Rebuild Your Nginx
```
$root@midascode:~/laravel/laradock/nginx# docker-compose down
$root@midascode:~/laravel/laradock/nginx# docker-compose build nginx
```
#### Re Run Your Containers MYSQL and NGINX
```
$root@midascode:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
```
###### View Your Site with HTTP ONLY (http://yourdomain.com)
#### Run Site on SSL with Let's Encrypt Certificate
###### Note: You need to Use Caddy here Instead of Nginx
###### To go Caddy Folders and Edit CaddyFile
```
$root@midascode:~/laravel/laradock# cd caddy
$root@midascode:~/laravel/laradock/caddy# vim Caddyfile
```
Remove 0.0.0.0:80
```
0.0.0.0:80
root /var/www/public
```
and replace with your https://yourdomain.com
```
https://yourdomain.com
root /var/www/public
```
uncomment tls
```
#tls self-signed
```
and replace self-signed with your email address
```
tls midascodebreaker@gmai.com
```
This is needed Prior to Creating Let's Encypt
#### Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt
```
$root@midascode:~/laravel/laradock/caddy# docker-compose up caddy
```
you will be prompt here to enter your email... you may enter it or not
```
Attaching to laradock_mysql_1, laradock_caddy_1
caddy_1 | Activating privacy features...
caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt.
caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at:
caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf
caddy_1 | Activating privacy features... done.
caddy_1 | https://yourdomain.com
caddy_1 | http://yourdomain.com
```
After it finish Press Ctrl + C to exit ...
#### Stop All Containers and ReRun Caddy and Other Containers on Background
```
$root@midascode:~/laravel/laradock/caddy# docker-compose down
$root@midascode:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
```
View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)
##### Note that Certificate will be Automatically Renew By Caddy
>References:
>
- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04)
- [https://www.digitalocean.com/products/one-click-apps/docker/](https://www.digitalocean.com/products/one-click-apps/docker/)
- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/)
- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https)
- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls)
- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile)
FROM adminer:4.3.0
# Version 4.3.1 contains PostgreSQL login errors. See docs.
# See https://sourceforge.net/p/adminer/bugs-and-features/548/
MAINTAINER Patrick Artounian <partounian@gmail.com>
# Add volume for sessions to allow session persistence
VOLUME /sessions
# We expose Adminer on port 8080 (Adminer's default)
EXPOSE 8080
......@@ -6,11 +6,13 @@ ARG PHP_SOCKET=php-fpm:9000
ENV WEB_PHP_SOCKET=$PHP_SOCKET
ENV WEB_DOCUMENT_ROOT=/var/www/public
ENV WEB_DOCUMENT_ROOT=/var/www/public/
EXPOSE 80 443
WORKDIR /var/www/public
WORKDIR /var/www/public/
COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
......
*.conf
!default.conf
!default.apache.conf
<VirtualHost *:80>
ServerName laradock.dev
DocumentRoot /var/www/public/
Options Indexes FollowSymLinks
<Directory "/var/www/public/">
AllowOverride All
<IfVersion < 2.4>
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName sample.dev
DocumentRoot /var/www/sample/public/
Options Indexes FollowSymLinks
<Directory "/var/www/sample/public/">
AllowOverride All
<IfVersion < 2.4>
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
Include /etc/apache2/sites-available/*.conf
......@@ -2,17 +2,17 @@ FROM alpine:3.4
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
ENV caddy_version=0.9.5
ENV caddy_version=0.10.0
LABEL caddy_version="$caddy_version" architecture="amd64"
RUN apk update \
&& apk upgrade \
&& apk add tar curl
&& apk add tar curl git
RUN curl --silent --show-error --fail --location \
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
"https://caddyserver.com/download/build?os=linux&arch=amd64&features=cloudflare%2Cdigitalocean%2Cdnsimple%2Cdyn%2Cgooglecloud%2Clinode%2Croute53" \
"https://caddyserver.com/download/linux/amd64?plugins=http.cgi,http.cors,http.expires,http.filemanager,http.git,http.ipfilter,http.realip,tls.dns.cloudflare,tls.dns.digitalocean,tls.dns.dnspod,tls.dns.dyn,tls.dns.googlecloud,tls.dns.linode,tls.dns.namecheap,tls.dns.ovh,tls.dns.route53,tls.dns.vultr" \
| tar --no-same-owner -C /usr/bin/ -xz caddy \
&& mv /usr/bin/caddy /usr/bin/caddy \
&& chmod 0755 /usr/bin/caddy
......@@ -21,4 +21,4 @@ EXPOSE 80 443 2015
WORKDIR /var/www/public
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"]
\ No newline at end of file
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"]
FROM phusion/baseimage:latest
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
COPY run-certbot.sh /root/certbot/run-certbot.sh
RUN apt-get update
RUN apt-get install -y letsencrypt
ENTRYPOINT bash -c "bash /root/certbot/run-certbot.sh && sleep infinity"
#!/bin/bash
letsencrypt certonly --webroot -w /var/www/letsencrypt -d "$CN" --agree-tos --email "$EMAIL" --non-interactive --text
cp /etc/letsencrypt/archive/"$CN"/cert1.pem /var/certs/cert1.pem
cp /etc/letsencrypt/archive/"$CN"/privkey1.pem /var/certs/privkey1.pem
This diff is collapsed.
---
title: Getting Started
type: index
weight: 2
---
## Requirements
- [Git](https://git-scm.com/downloads)
- [Docker](https://www.docker.com/products/docker/) `>= 1.12`
## Installation
Choose the setup the best suits your needs.
#### A) Setup for Single Project:
*(In case you want a Docker environment for each project)*
##### A.1) Setup environment in existing Project:
*(In case you already have a project, and you want to setup an environment to run it)*
1 - Clone this repository on your project root directory:
```bash
git submodule add https://github.com/Laradock/laradock.git
```
*Note 1: If you are not yet using Git for your PHP project, you can use `git clone https://github.com/Laradock/laradock.git` instead.*
*Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. [Check this](#keep-tracking-LaraDock)*
*Note 3: In this case the folder structure will be like this:*
```
- project1
- laradock
- project2
- laradock
```
##### A.2) Setup environment first then create project:
*(In case you don't have a project, and you want to create your project inside the Docker environment)*
1 - Clone this repository anywhere on your machine:
```bash
git clone https://github.com/laradock/laradock.git
```
Note: In this case the folder structure will be like this:
```
- projects
- laradock
- myProject
```
2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../myProject:/var/www`).
3 - Stop and re-run your docker-compose command for the changes to take place.
```
docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
```
#### B) Setup for Multiple Projects:
1 - Clone this repository anywhere on your machine:
```bash
git clone https://github.com/laradock/laradock.git
```
2 - Edit the `docker-compose.yml` file to map to your projects directories:
```
applications:
image: tianon/true
volumes:
- ../project1/:/var/www/project1
- ../project2/:/var/www/project2
```
3 - You can access all sites by visiting `http://localhost/project1/public` and `http://localhost/project2/public` but of course that's not very useful so let's setup NGINX quickly.
4 - Go to `nginx/sites` and copy `sample.conf.example` to `project1.conf` then to `project2.conf`
5 - Open the `project1.conf` file and edit the `server_name` and the `root` as follow:
```
server_name project1.dev;
root /var/www/project1/public;
```
Do the same for each project `project2.conf`, `project3.conf`,...
6 - Add the domains to the **hosts** files.
```
127.0.0.1 project1.dev
```
7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.
## Usage
**Read Before starting:**
If you are using **Docker Toolbox** (VM), do one of the following:
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading LaraDock](#upgrading-laradock)
- Use LaraDock v3.* (Visit the `LaraDock-ToolBox` [Branch](https://github.com/laradock/laradock/tree/LaraDock-ToolBox)).
<br>
>**Warning:** If you used an older version of LaraDock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent errors as much as possible.
<br>
1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
**Example:** Running NGINX and MySQL:
```bash
docker-compose up -d nginx mysql
```
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
You can select your own combination of Containers form the list below:
`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`, `elasticsearch`, `rethinkdb`.
<br>
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...).
```bash
docker-compose exec workspace bash
```
Alternatively, for Windows PowerShell users: execute the following command to enter any running container:
```bash
docker exec -it {workspace-container-id} bash
```
**Note:** You can add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. (you can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml`).
<br>
3 - Edit your project configurations.
Open your `.env` file and set the `DB_HOST` to `mysql`:
```env
DB_HOST=mysql
```
*If you want to use Laravel and you don't have it installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
<br>
4 - Open your browser and visit your localhost address (`http://localhost/`).
<br>
**Debugging**: if you are facing any problem here check the [Debugging](#debugging) section.
If you need a special support. Contact me, more details in the [Help & Questions](#Help) section.
---
title: Welcome
type: index
weight: 0
---
/*
* overwrite the current primary color of the
* theme that is used as fallback in codeblocks
*/
.article pre code {
color: rgba(0, 0, 0, 0.8) !important;
}
/*
HIGHLIGHT.JS THEME
tweaked version of the Github theme
*/
.hljs {
display:block;
overflow-x:auto;
}
.hljs-comment,
.hljs-quote {
color:#998;
font-style:italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color:#333;
font-weight:700;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color:teal;
}
.hljs-string,
.hljs-doctag {
color:#d14;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
color:#900;
font-weight:700;
}
.hljs-subst {
font-weight:400;
}
.hljs-type,
.hljs-class .hljs-title {
color:#458;
font-weight:700;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
color:navy;
font-weight:400;
}
.hljs-regexp,
.hljs-link {
color:#009926;
}
.hljs-symbol,
.hljs-bullet {
color:#990073;
}
.hljs-built_in,
.hljs-builtin-name {
color:#0086b3;
}
.hljs-meta {
color:#999;
font-weight:700;
}
.hljs-deletion {
background:#fdd;
}
.hljs-addition {
background:#dfd;
}
.hljs-emphasis {
font-style:italic;
}
.hljs-strong {
font-weight:700;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment