Adding project documentation

This commit is contained in:
cytopia 2016-11-06 17:49:48 +01:00
parent b85dda99d9
commit d1c7c27a54
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
2 changed files with 99 additions and 10 deletions

View File

@ -9,13 +9,13 @@ There is currently a huge annoyance with docker on OSX resulting in very slow fi
----
[Usage](https://github.com/cytopia/devilbox#usage) |
[Video Tutorials](https://github.com/cytopia/devilbox#video-tutorials) |
[Documentation](https://github.com/cytopia/devilbox#documentation) |
[Run-time Matrix](https://github.com/cytopia/devilbox#run-time-matrix) |
[Features](https://github.com/cytopia/devilbox#feature-overview) |
[Intranet](https://github.com/cytopia/devilbox#intranet-overview) |
[Contributing](https://github.com/cytopia/devilbox#contributing) |
[Screenshots](https://github.com/cytopia/devilbox#screenshots) |
[License](https://github.com/cytopia/devilbox/blob/master/LICENSE.md) |
[Contributing](https://github.com/cytopia/devilbox#contributing) |
[Todo](https://github.com/cytopia/devilbox/blob/master/CONTRIBUTING.md)
[![Build Status](https://travis-ci.org/cytopia/devilbox.svg?branch=master)](https://travis-ci.org/cytopia/devilbox) ![Tag](https://img.shields.io/github/tag/cytopia/devilbox.svg) [![type](https://img.shields.io/badge/type-Docker-orange.svg)](https://www.docker.com/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
@ -54,11 +54,17 @@ $ docker-compose up
[What is the `.env` file?](https://docs.docker.com/compose/env-file/)
## Video Tutorials
## Documentation
**Video Tutorials**
[![Devilbox setup and workflow](https://raw.githubusercontent.com/cytopia/devilbox/master/doc/img/devilbox_01-setup-and-workflow.png "devilbox - setup and workflow")](https://www.youtube.com/watch?v=reyZMyt2Zzo)
[![Devilbox email catch-all](https://raw.githubusercontent.com/cytopia/devilbox/master/doc/img/devilbox_02-email-catch-all.png "devilbox - email catch-all")](https://www.youtube.com/watch?v=e-U-C5WhxGY)
**Documentation**
For setup, usage and examples see detailed **[Documentation](https://github.com/cytopia/devilbox/blob/master/doc/README.md)**.
## Run-time Matrix
Select your prefered setup.
@ -106,7 +112,6 @@ No need to install and configure different versions locally. Simply choose your
| todo | todo | todo | todo |
-->
## Feature overview
* Dynamically Configured **Mass Virtual Hosting**
@ -138,12 +143,6 @@ The devilbox comes with a pre-configured intranet on `http://localhost`
* Opcache GUI
## Contributing
There is quite a lot todo and planned. If you like to contribute, view [CONTRIBUTING.md](https://github.com/cytopia/devilbox/blob/master/CONTRIBUTING.md) and [ROADMAP](https://github.com/cytopia/devilbox/issues/23).
Contributors will be credited within the intranet and on the github page.
## Screenshots
@ -181,3 +180,11 @@ Shows you all the databases that are loaded
Shows you all the emails that have been sent. No email will actually be sent outside, but they are all catched by one account and presented here.
![Intranet Email](https://raw.githubusercontent.com/cytopia/devilbox/master/doc/img/04_intranet_emails.png "Intranet Home")
## Contributing
There is quite a lot todo and planned. If you like to contribute, view [CONTRIBUTING.md](https://github.com/cytopia/devilbox/blob/master/CONTRIBUTING.md) and [ROADMAP](https://github.com/cytopia/devilbox/issues/23).
Contributors will be credited within the intranet and on the github page.

82
doc/README.md Normal file
View File

@ -0,0 +1,82 @@
# Documentation
## Adding projects
As an example, we are going to add two projects.
**Prerequisites**
For this case let's assume your www root folder points to `~/www`. This means your projects will reside on your host computer in your home directory under www.
In order to achive this set `HOST_PATH_TO_WWW_DOCROOTS=~/www` in the `.env` file (If this file does not yet exist, copy `env-example` to `.env`).
`.env`:
```
...
HOST_PATH_TO_WWW_DOCROOTS=~/www
...
```
**Desired Projects**
| Project name | Document Root | URL |
|--------------|---------------|-----|
| devilbox | ~/www/devilbox/htdocs | http://devilbox.loc |
| foo.bar | ~/www/foo.bar/htdocs | http://foo.bar.loc |
`htdocs` can either be a folder or a symlink to a folder.
**Project: devilbox**
Setup projects folder and an `index.php` (on your host computer)
```shell
$ mkdir -p ~/www/devilbox/htdocs
$ vim ~/devilbox/htdocs/index.php
```
```php
<?php
echo 'hello world';
?>
```
Adjust your local (host computer) `/etc/hosts` and point `devilbox.loc` to your localhost address `127.0.0.1`
```shell
$ sudo vim /etc/hosts
```
```shell
127.0.0.1 devilbox.loc
```
**Project: foo.bar**
Setup projects folder and use existing github project to serve.
```shell
$ mkdir -p ~/www/foo.bar
$ cd ~/www/foo.bar
# Use an existing github project as your document root
$ git clone https://github.com/<user>/<some-project>
# Symlink the project to htdocs
$ ln -s <some-project> htdocs
$ ls -l
drwxr-xr-x 4 cytopia 1286676289 136 Oct 30 14:24 <some-project>/
lrwxr-xr-x 1 cytopia 1286676289 549 Nov 6 15:13 htdocs -> <some-project>/
```
Adjust your local (host computer) `/etc/hosts` and point `foo.bar.loc` to your localhost address `127.0.0.1`
```shell
$ sudo vim /etc/hosts
```
```shell
127.0.0.1 foo.bar.loc
```